tag:blogger.com,1999:blog-8085117242240449595.post3956120402486336889..comments2023-12-21T05:46:31.718-05:00Comments on Muhammad Shujaat Siddiqi: WPF Validation - Using Validation Application BlockMuhammad Shujaat Siddiqihttp://www.blogger.com/profile/02519138704633566929noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-8085117242240449595.post-59506777829342426722010-08-22T21:40:56.594-04:002010-08-22T21:40:56.594-04:00Brian,
Did you reference System.ComponentModel.Dat...Brian,<br />Did you reference System.ComponentModel.DataAnnotation?Muhammad Shujaat Siddiqihttps://www.blogger.com/profile/02519138704633566929noreply@blogger.comtag:blogger.com,1999:blog-8085117242240449595.post-59128764137231002502010-08-20T10:46:34.819-04:002010-08-20T10:46:34.819-04:00Here is the exact error...
System.FormatException...Here is the exact error...<br /><br />System.FormatException was unhandled<br /> Message="Index (zero based) must be greater than or equal to zero and less than the size of the argument list."<br /> Source="mscorlib"<br /> StackTrace:<br /> at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)<br /> at System.String.Format(IFormatProvider provider, String format, Object[] args)<br /> at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator.GetMessage(Object objectToValidate, String key) in e:\Builds\EntLib\Latest\Source\Blocks\Validation\Src\Validation\Validators\StringLengthValidator.cs:line 184<br /> at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator.DoValidate(String objectToValidate, Object currentTarget, String key, ValidationResults validationResults) in e:\Builds\EntLib\Latest\Source\Blocks\Validation\Src\Validation\Validators\StringLengthValidator.cs:line 167<br /> at Microsoft.Practices.EnterpriseLibrary.Validation.Validator`1.DoValidate(Object objectToValidate, Object currentTarget, String key, ValidationResults validationResults) in e:\Builds\EntLib\Latest\Source\Blocks\Validation\Src\Validation\Validator.Generic.cs:line 114<br /> at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.ValueAccessValidator.DoValidate(Object objectToValidate, Object currentTarget, String key, ValidationResults validationResults) in e:\Builds\EntLib\Latest\Source\Blocks\Validation\Src\Validation\Validators\ValueAccessValidator.cs:line 70<br /> at Microsoft.Practices.EnterpriseLibrary.Validation.Validator.Validate(Object target) in e:\Builds\EntLib\Latest\Source\Blocks\Validation\Src\Validation\Validator.cs:line 49<br /> at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WPF.ValidatorRule.Validate(Object value, CultureInfo cultureInfo) in e:\Builds\EntLib\Latest\Source\Blocks\Validation\Src\Validation.Integration.WPF\ValidatorRule.cs:line 91<br />...Briannoreply@blogger.comtag:blogger.com,1999:blog-8085117242240449595.post-11275307585495754192010-08-20T00:44:16.032-04:002010-08-20T00:44:16.032-04:00I tried your approach describing validation specif...I tried your approach describing validation specification in attributes. <br /><br />I get an error message in StringLengthValidator.cs on line 184 within the GetMessage routine with a FormatException indicating that "Index (zero based) must be greater than or equal to zero and less than the size of the argument list.".<br /><br />CurrentInfo.Culture = en_US<br />MessageTemplate = "xxx"<br />objectToValidate = "input string"<br />key = ""<br />ttg = null<br />LowerBound = 5<br />LowerBoundType = ...Inclusive<br />UpperBound = 20<br />UpperBoundType = ...Inclusive<br /><br />Have you encountered this before? I am trying to determine why this happening.Briannoreply@blogger.com