Answered by:
The namespace 'Resources' already contains a definition for

Question
-
User-393676364 posted
Hi,
I am working with .net2.0 Resource Files(Resx).
after coping the Colture specific file in the App_GlobalResources and compiling I got the following error message.
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.Compiler Error Message: CS0101: The namespace 'Resources' already contains a definition for 'CommonMessages'
Source Error:
Line 24: [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 25: [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
Line 26: public class CommonMessages {
Line 27:
Line 28: private static global::System.Resources.ResourceManager resourceMan;
I don't know why it happens?Thursday, January 17, 2008 5:04 AM
Answers
-
User-393676364 posted
Hi, I got the reason of this error mesage. I am using the wrong culture name for file.
Just check the culture name you are using is present or not.
eg. CommonMessages.fe-ex.the Fr-ex is not valid culture so the above given errors occured while building the application.
you can check the supported Culture s from IE-Browser. Tools-Internate Options- Languages-Add languages
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, August 29, 2008 8:34 AM
All replies
-
User1187105292 posted
I'm guessing you have two entries in the same resource file with the key of CommonMessages.
Thursday, January 17, 2008 9:56 AM -
User1827201912 posted
Hi,
Welcome to the ASP.NET forums.
How many resx files do you have in your App_Global folder? If you have more than one resx file in your App_Global, try renaming the other one (to let us say Resource.resx_old).
See if that solves your problems
HTH,
Suprotim Agarwal-----
http://www.dotnetcurry.com
-----
Thursday, January 17, 2008 9:56 AM -
User-393676364 posted
Hi,
First only One Resource file is present in the App_GlobalResources Folder. eg: CommonMessages.resx
then we Programitically create the another file for different culture eg: CommonMessages.sv-SE.resx and copies the file to the App_GlobalResources folder
Now there are two files CommonMessages.resx and CommonMessages.sv-SE.resx with diferent names.
When compliling the Application we get the error Given above.
so what's the reason for occuring this error.Thanks for your helpFriday, January 18, 2008 12:34 AM -
User1187105292 posted
I work with a 3rd party framework that uses resource files to handle multi-lingual issues.
They arrange things a different way.
All the resource files have the exact same name. The "default" resource file is in the regular resources directory, and each language is in a language sub-directory below it. The sub-directory name is the language/culture code, i.e., ca-ES, da, de, es, es-ES, fr, hr, it, and so forth.
Hope that helps!
Friday, January 18, 2008 12:33 PM -
User-2137848081 posted
I have the same issue even thought the procedure is described here http://msdn.microsoft.com/en-us/library/fw69ke6f(VS.80).aspx
Thursday, August 7, 2008 11:42 AM -
User50916595 posted
I also have the same problem anyone run into a solution?Friday, August 29, 2008 3:09 AM -
User-393676364 posted
Hi, I got the reason of this error mesage. I am using the wrong culture name for file.
Just check the culture name you are using is present or not.
eg. CommonMessages.fe-ex.the Fr-ex is not valid culture so the above given errors occured while building the application.
you can check the supported Culture s from IE-Browser. Tools-Internate Options- Languages-Add languages
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, August 29, 2008 8:34 AM -
User-2137848081 posted
I found some caveats with this localization stuff, mostly with regard to the naming of the files, I've documented it here http://learnerps-dotnet.blogspot.com/2008/08/localization-and-globalization.html#links
Tuesday, September 2, 2008 5:35 AM -
User1062200218 posted
You just check that you make a duplicate or renamed .aspx file that have refrance to same class,if this is ok then check your global app folder for duplicate resource file.
Tuesday, May 26, 2009 7:35 AM -
User853822827 posted
Hi,
I have a same problem. could you help me fix it please? I don't know what should I do. need help please?
Monday, June 8, 2009 9:05 AM -
User1808133441 posted
Hi,
I have a same problem. could you help me fix it please? I don't know what should I do. need help please?
I came across a novel realisation of why this error showed up in my project !!! I'd saved my *.cs file into a different folder - deleted the original because it showed some strange link icon and thought I'd recreate it in my target folder seeing as my solution had no listing of my *.cs file now.
Sure enough the above definition got me thinking and I did a full search for the name of my .cs file which seemed to have a duplicate somewhere..... I didn't know Windows XP could have two of the exact same named file in the same folder tree of a project - but it did... so I deleted the older one !
Talk about learning something new ! :-DFriday, June 19, 2009 1:37 PM -
User1415113903 posted
Nice one satishambition, your suggestion was the solution. I was using se for Sweden, I should have been using sv.
Friday, April 30, 2010 11:02 AM -
User-1894275904 posted
I also have the same problem.
The error occurs because specific culture was not installed on build station.
Tuesday, November 16, 2010 5:46 AM -
User1332120964 posted
Hi,
I got a same issue, i used .net framework 3.5 and, tried to use culture name as "s-LK" that is for sinhala. I got this errror when im using windows XP pc, when i just check this using windows 7 doesn't generate any compile error.
Monday, April 11, 2011 11:59 PM