What are the best usage of the following resource files.
- Properties → Resources (Phil used this resource for localization in DataAnnotation)
- App_GlobalResources folder
- App_LocalResources folder
I also would like to know what is the difference between (1) and (2) in asp.net mvc application.
Best Answer
You should avoid
App_GlobalResources
andApp_LocalResources
. Like Craig mentioned, there are problems withApp_GlobalResources
/App_LocalResources
because you can't access them outside of the ASP.NET runtime. A good example of how this would be problematic is when you're unit testing your app.K. Scott Allen blogged about this a while ago. He does a good job of explaining the problem with
App_GlobalResources
in ASP.NET MVC here.