Validation Bug: Getting MessageTemplate from resource file not working if using configuration

Topics: Validation Application Block
May 18, 2007 at 6:31 PM
If you use the config file to wire up the validations the use of MessageTemplateResourceTypeName is flawed.

You can pick your assembly to assign to MessageTemplateResourceTypeName from the config tool and that's fine but the code determines the resource basename from the fullname of the class picked for the MessageTemplateResourceTypeName which will not be the resource base name. Since you can only derive an assembly from a class and not a resource the config tool will have to allow you to input in the resource base name. This hoses anyone who plans on using localized strings if you externalize the validations in a config file.

May 19, 2007 at 11:23 PM
I added this as a WorkItem:

I cannot get Resources to work via a configuration file.

I also have a problem that you can just type gibberish in the ResourceName and ResourceTypeName Fields in Configuration and the VAB does not throw an error to let you know the resource file and/or resource does not exist.




David Hayden
Microsoft MVP C#