C
CGuy
Hi,
I'm trying to develop an ASPX page that supports multiple languages.
Everything has gone well till now -
1. Created a project in VS.NET 2003
2. Added 2 resource files named Captions.resx and Captions.fr.resx for
English and French cultures respectively
3. Used the following code in the ASPX Code Behind file
resourceManager = new ResourceManager("MyProject.Captions",
Assembly.GetExecutingAssembly());
this.Label.Text = resourceManager.GetString("LABEL_CAPTION");
4. Compiled the project in VS.NET 2003. The page loads fine with the
label's caption set to English or French (depending on the Culture)
Now the problem
Since I plan to support more languages and there are going to be more
resource files (per language, per category etc), I would like to organize
them into several directories. So, I moved both my resource files into a
"Resources" directory and recompiled the project - BOOM - get a runtime
error saying:
"Could not find any resources appropriate for the specified culture (or the
neutral culture) in the given assembly. Make sure
"MyProject.Captions.resources" was correctly embedded or linked into
assembly "MyProject". baseName: MyProject.Captions locationInfo: <null>
resource file name: MyProject.Captions.resources assembly: MyProject,
Version=1.0.1361.33724, Culture=neutral, PublicKeyToken=null "
I guess the problem is due to the fact that VS.NET is unable to locate the
resx files during compilation. How do I fix this problem? Any help in this
matter is greatly appreciated.
CGuy
I'm trying to develop an ASPX page that supports multiple languages.
Everything has gone well till now -
1. Created a project in VS.NET 2003
2. Added 2 resource files named Captions.resx and Captions.fr.resx for
English and French cultures respectively
3. Used the following code in the ASPX Code Behind file
resourceManager = new ResourceManager("MyProject.Captions",
Assembly.GetExecutingAssembly());
this.Label.Text = resourceManager.GetString("LABEL_CAPTION");
4. Compiled the project in VS.NET 2003. The page loads fine with the
label's caption set to English or French (depending on the Culture)
Now the problem
Since I plan to support more languages and there are going to be more
resource files (per language, per category etc), I would like to organize
them into several directories. So, I moved both my resource files into a
"Resources" directory and recompiled the project - BOOM - get a runtime
error saying:
"Could not find any resources appropriate for the specified culture (or the
neutral culture) in the given assembly. Make sure
"MyProject.Captions.resources" was correctly embedded or linked into
assembly "MyProject". baseName: MyProject.Captions locationInfo: <null>
resource file name: MyProject.Captions.resources assembly: MyProject,
Version=1.0.1361.33724, Culture=neutral, PublicKeyToken=null "
I guess the problem is due to the fact that VS.NET is unable to locate the
resx files during compilation. How do I fix this problem? Any help in this
matter is greatly appreciated.
CGuy