Question

I've developed a custom validator and used the validator through Enterprise Library Configuration Console. However the type attribute of the custom validator in the config xml is coming as blank instead of the actual type of the custom validator. I've done the following steps so far:

  1. Created custom validator inheriting from ValueValidator.
  2. Created attribute based on the custom validator.
  3. Created custom value validator data inheriting from ValueValidatorData.
  4. Copied the built dll to the Enterprise Library Configuration Console's directory.
  5. Added the same path to soln's "Enterprise Library v6 Binaries Path".

After doing the above steps the custom validator started to come in the console's validator list. Applying the validator, all the value validator data came correctly in the console. However saving the configuration leaves the value of type attribute empty in the config xml.

Have I missed anything?

P.S: Just for your information the validator works fine after I added the type manually in the xml, but the type is not coming automatically in the xml is a bit frustrating.

Was it helpful?

Solution

Well it is quite late, but if anyone is looking for the answer, here it is.

You need to necessarily add the following

inside the constructors of your custom ValueValidatorData:

this.Type = typeof(Here_goes_your_custom_validator);

You can also check Sarah Urmeneta's post dated Sep 22, 2010: https://entlib.codeplex.com/discussions/227578

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top