Why am I getting the App_GlobalResources assembly? (Error = CS0433)

I am working on an ASP.NET MVC2 project for which I configured localization as follows ...


I have a separate resource assembly containing all my resx files. Settings for each resx file ...
  Build Action = Embedded Resource
 Copy to Output Directory = Do not copy
 Custom Tool = PublicResXFileCodeGenerator
 Custom Tool Namespace = Resources

I have a tool that exports rows from a database to resx files and calls the resgen.exe tool to recreate the designer.cs file.


All this worked fine even when I changed the language settings of my browser and refreshed the page. He will pick up the correct lines.

This was in a temporary working folder (I use subversion). Now I got to work in a regular folder and get a rather strange error.

Compiler Error Message: CS0433: type 'Resources.XXXX' exists in both "C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Temporary ASP.NET Files \ root \ 6c657d01 \ aaca70ae \ assembly \ DL3 \ a36dac65 \ 78c87110_3724cb01 \ Resources.DLL "as well as" C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Temporary ASP.NET Files \ root \ 6c657d01 \ aaca70ae \ App_GlobalResources.g6fehiio.dll '

I deleted all my asp.net temporary files, re-launched the web application and restored both of the above builds. The strangest thing is that all this worked before I went to my usual working folder.

So, can anyone tell me what generates this assembly App_GlobalResources, which I do not need or do not need, because all my resources are contained in the resource assembly that I created.

PS - The reason I went with Resource.dll was to get around the problem I was working with creating resources using my database extraction tool. (see here )

PPS - I am using VS2010

+2
source share
3 answers

Doh!

I think when I switched my "regular working folder" to the branch I was in, I had some files in the "App_GlobalResources" folder.

I just tried to create a new App_GlobalResources folder in VS2010, and he said that it was already there, but that was not in the solution explorer.

I looked in windows explorer several times and just did not see this folder.

In any case, the problem is solved!

moral: do not trust the solution developer or svn switch to delete files that do not belong to the working copy: '(

+4
source

Although I do not know how to stop App_GlobalResources to automatically generate assemblies in temporary ASP.NET files. I figured out how to get rid of these annoying warnings.

As the warning says:

Compiler Error Message: CS0433: The type 'Resources.XXXX' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\6c657d01\aaca70ae\assembly\dl3\a36dac65\78c87110_3724cb01\Resources.DLL' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\6c657d01\aaca70ae\App_GlobalResources.g6fehiio.dll'

In both assemblies, there is a type Resources.XXXX . Change your Custom Tool Namespace as something other than "Resources" and these warnings will disappear.

0
source
  • Move .resx to another folder (not App_GlobalResources)
  • Hold Resource in your custom tool namespace
0
source

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


All Articles