VAB ignores Inheritance when configuring rules in config file

Topics: Validation Application Block
Aug 22, 2007 at 6:03 PM
I have an interesting situation and am getting confusing results.

I have a class hierarchy with base class and several sub-classes. I would like to apply validation rules at the base class for common fields and have sub-classes inherit those rules. I can do this by applying attributes to the fields in base class. However, this does not work when I apply the rules on the base type using the web.config and not the attributes. VAB does not respect inheritance when reading rules from the config file.

Is this "working as desgined"? Is there any workaround for this other then just hard coding my validation rules via attributes in the base class?


Aug 22, 2007 at 11:02 PM

This is really by design. The work around is to replicate the validation specification of the base class' properties for the subclasses, and it's certainly not practical.

Sep 10, 2008 at 11:29 AM
Edited Sep 10, 2008 at 11:30 AM

This can't be true. Is it on the to do list for the next version that the rules in the config behave just like the rules in attributes? Or should I open an issue? To me, this is a bug by design.

With best regards
Oct 19, 2009 at 2:59 PM


I faced with the problem using EntLib 4.1, Is there an opened issue for the problem? As it was noticed above it looks like bug because no one expects such behaviour.

Oct 20, 2009 at 2:54 AM

Here is a link to workitem in the issue tracker -


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.

Oct 20, 2009 at 7:45 AM

Thanks for reply.