App_GlobalResources in ASP.NET MVC 2 and VS 2010?

Good afternoon!

I installed VS 2010 Express and the resource files in App_GlobalResources not compiled into the strongly typed Resources class. More specifically, no code generation occurs.

I tested my MVC project (upgraded from MVC 1.0 and VS2008) and the empty ASP.NET MVC 2.0 project created by VS and received an error (even when trying to start code generation manually in the right-click menu):

 Cannot find custom tool 'GlobalResourceProxyGenerator' on this system. 

When I change my own tool to PublicResXFileCodeGenerator , as suggested here: http://odetocode.com/blogs/scott/archive/2009/07/15/resource-files-and-asp-net-mvc-projects.aspx

classes are generated.

App_GlobalResources works for Web Forms projects on a single computer \ VS.

Should I not use App_GlobalResources for MVC at all?

Thanks!

+4
source share
1 answer

A quick fix is ​​to simply create the Resources folder, move all the resx files and change the resx properties as described here:

http://odetocode.com/blogs/scott/archive/2009/07/15/resource-files-and-asp-net-mvc-projects.aspx

Resource strings will be available through Resources.

+4
source

Source: https://habr.com/ru/post/1309925/


All Articles