0

I am getting this error when trying to run my ASP.NET 4.6.1 C# web project:

The namespace 'Resources' already contains a definition for 'WebResources'

This happened after I've added a new Korean language resource file to the App_GlobalResource.

There is only one WebResource.resx file in that directory. I've checked the latest resx file (Korean) and it is generated correctly with public class WebResources_kr.

The error points to this file:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\29af3b9e\d233fd91\App_GlobalResources.cuxuxaly.0.cs

I tried to rebuild the solution, remove the temporary ASP.NET file but the problem still persist.

Update: I deleted the generated code at WebResources.kr.designer.cs, because I see that no other of the languages has this generated, only the main WebResource.designer.cs. I tried to run again, but with the same error.

Liron Harel
  • 10,819
  • 26
  • 118
  • 217
  • 1
    This thread should be helpful https://stackoverflow.com/questions/7035437/how-to-fix-namespace-x-already-contains-a-definition-for-x-error-happened-aft#7065387 – Roman Svitukha Sep 07 '18 at 15:06
  • It was because I used KR instead of KO, thank you Roman, you saved me hours! – Liron Harel Sep 07 '18 at 15:09

0 Answers0