VAB: After Integration with WCSF

Topics: Pre-release discussions, Validation Application Block
Mar 7, 2007 at 4:21 PM
Hi,

I am using WCSF in my current development. Now I am trying to include VAB in my appliction. I did general stuff like, created rules and included PropertyProxyValidator. In my application nt using Exception,Logging & Authentication Application Blocks. So I removed those stuff.(This is for Info)
With-out VAB, the application running without any failure.

I am getting the following error:
**************************************ERROR STARTS******************************

The property name required to retrieve validation information for integration is invalid or does not belong to a public property.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The property name required to retrieve validation information for integration is invalid or does not belong to a public property.
**************************************ERROR ENDS******************************

Here is the my sample Web.Config file.
**************************************Web.Config******************************

<configuration>
<configSections>
<section name="validation" type="Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.ValidationSettings, Microsoft.Practices.EnterpriseLibrary.Validation, Version=2.9.9.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<sectionGroup name="compositeWeb">
<section name="modules" type="Microsoft.Practices.CompositeWeb.Configuration.ModulesConfigurationSection, Microsoft.Practices.CompositeWeb" />
</sectionGroup>
</configSections>
<validation>
<type assemblyName="Shipping.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
name="Shipping.Web.UI.WebControls.TextBoxNemo">
<ruleset name="TextBoxNemoRuleSetFirstName">
<properties>
<property name="Text_FirstName">
<validator lowerBound="0" lowerBoundType="Ignore" upperBound="8"
upperBoundType="Inclusive" negated="false" messageTemplate=""
messageTemplateResourceName="" messageTemplateResourceType=""
tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=2.9.9.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="TextBoxNemoRuleSetFirstName" />
</property>
</properties>
</ruleset>
<ruleset name="TextBoxNemoRuleSetLastName">
<properties>
<property name="Text_LastName">
<validator lowerBound="0" lowerBoundType="Ignore" upperBound="10"
upperBoundType="Inclusive" negated="false" messageTemplate="Should be less or equal to 10 chars"
messageTemplateResourceName="" messageTemplateResourceType=""
tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=2.9.9.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="TextBoxNemoRuleSetLastName" />
</property>
</properties>
</ruleset>
</type>
</validation>

**************************************Web.Config******************************

As part of EntLib3.0, there is no file corresponding "Microsoft.Practices.CompositeWeb.dll" in the stallation. Apart from all files are present. I am using the older one(EntLib2.0) --May be this is the error.
But in the given samples, this dll is not required. So they are not included in the proj. But in WCSF we need this dll. What would be the solution?


Regards,
Ramesh T
Oct 8, 2010 at 3:09 PM
Edited Oct 8, 2010 at 3:29 PM

I have the same error with EntLib 5.0 validation: The property name required to retrieve validation information for integration is invalid or does not belong to a public property.

Oct 8, 2010 at 3:38 PM

Found a few issues and solutions:

This error could be caused if...

  1. You are using a custom or "proxy" validator
  2. The class being validated uses Fields instead of Properties (e.g. get;set;)
  3. You are using ValidationProvider in WinForms and have not properly set the "SourceTypeName" property to the correct type

Solutions:

  1. Turn on debugging of CLR Exceptions (Debug -> Exceptions -> Common Language Runtime Exceptions = "Thrown")
  2. Ensure that the EntLib source code is installed on your machine, so you can step into their code to see the exact line the exception is occuring on
  3. For custom/proxy validators, ensure configuration is correct
  4. Ensure the class validated is using Properties and not Fields
  5. For WinForms ValidationProvider, ensure the "SourceTypeName" is set correctly

For reference, here is a blog entry on the proxy validator issue and using Properties vs. Fields:
http://devshed.us/Blogs/tabid/227/EntryId/202/Enterprise-Library-The-property-name-required-to-retrieve-validation-information-for-integration-is-invalid-or-does-not-belong-to-a-public-property.aspx