I have my resource files in separate assembly MyApp.Resources.dll. I can use the resources without any problem but the issue appears when I want to change (localize) the default validation messages:
"The {0} field is required." and "The value '{0}' is not valid for {1}."
The solution DefaultModelBinder.ResourceClassKey = "MyApp.Resources.Global";
does not work because it requires the ResourceClassKey to be under App_GlobalResources folder in the web project.
What should be the fix for me ?
Regards
Best Answer
I have found solution for this case (when resources are in separate assembly).
To get it working you should create custom ResourceProviderFactory and register it as default ResourceProviderFactoryType in
<globalization>
web.config section.Setup Localization
ValidationResourceProviderFactory
GlobalResourceProvider
UPD
RESX for ValidationResources
Just add new resources class as ValidationResources and place provided XML there