Mich Mich - 1 month ago 6
ASP.NET (C#) Question

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

Ok I have a issue with my resx files for some reason I have this error

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

all files are within App_GlobalResources but I keep getting this error

any pointers

Answer

There is the likelihood even if you have them hidden in Visual Studio that it’s trying to read a file which is similarly named,

If within GlobalResources you have more than 1 file try renaming the extension like this

From:

SiteResources-fr-FR.resx

To:

SiteResources-fr-Fr.old.resx
(this might still be read)

try changing the extension of the latter so that its complete not a resx file like:

SiteResources-fr-Fr.old

this will 100% not be a resx file now and should stop asp.net confusing the file you wish to use.

Hope this will solve your problems.

Comments