J
Jensen bredal
Hello there,
I need to implement globalisation in my asp.net app.
I have chosen to use text files to contains my string and use
ResGen.exe to build ressource dlls
I have written the following code in Global.asax.cs
*************
protected void Application_Start(Object sender, EventArgs e)
{
Assembly a = Assembly.GetExecutingAssembly();
ResMan = new ResourceManager("MyNameSpace.strings",
a); //My public Global resource member tha i use in // forms to access
resources.
}
.....
.......
.........
protected void Application_BeginRequest(Object sender, EventArgs e)
{
try
{
if (Request.UserLanguages != null)
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);
else
// Default to English if there are no user languages
Thread.CurrentThread.CurrentCulture = new
CultureInfo("en-us");
Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture;
}
catch
{
Thread.CurrentThread.CurrentCulture = new
CultureInfo("en-us");
//ex.
}
}
*************
i have of course build my string.Language-code.text with resgen.exe
Finally , in my my aspx.cs i use
rm= Global.Resman
to acces the string as follow:
Label.Text = rm.GetString("MyString"); where
MyString = Localtring in string.Language-code.text
when i lunch the application , i get the following error:
System.Resources.MissingManifestResourceException: Could not find any
resources appropriate for the specified culture (or the neutral culture) in
the given assembly. Make sure "MyNamespace.strings.resources" was correctly
embedded or linked into assembly "BouyOnsale". baseName: MyNamespace.strings
locationInfo: <null> resource file name: MyNamespace.strings.resources
assembly: BouyOnsale, Version=1.0.1640.35778, Culture=neutral,
PublicKeyToken=null
......................
Any idea what i'm doing wrong?
Thanks in advance
JB
I need to implement globalisation in my asp.net app.
I have chosen to use text files to contains my string and use
ResGen.exe to build ressource dlls
I have written the following code in Global.asax.cs
*************
protected void Application_Start(Object sender, EventArgs e)
{
Assembly a = Assembly.GetExecutingAssembly();
ResMan = new ResourceManager("MyNameSpace.strings",
a); //My public Global resource member tha i use in // forms to access
resources.
}
.....
.......
.........
protected void Application_BeginRequest(Object sender, EventArgs e)
{
try
{
if (Request.UserLanguages != null)
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);
else
// Default to English if there are no user languages
Thread.CurrentThread.CurrentCulture = new
CultureInfo("en-us");
Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture;
}
catch
{
Thread.CurrentThread.CurrentCulture = new
CultureInfo("en-us");
//ex.
}
}
*************
i have of course build my string.Language-code.text with resgen.exe
Finally , in my my aspx.cs i use
rm= Global.Resman
to acces the string as follow:
Label.Text = rm.GetString("MyString"); where
MyString = Localtring in string.Language-code.text
when i lunch the application , i get the following error:
System.Resources.MissingManifestResourceException: Could not find any
resources appropriate for the specified culture (or the neutral culture) in
the given assembly. Make sure "MyNamespace.strings.resources" was correctly
embedded or linked into assembly "BouyOnsale". baseName: MyNamespace.strings
locationInfo: <null> resource file name: MyNamespace.strings.resources
assembly: BouyOnsale, Version=1.0.1640.35778, Culture=neutral,
PublicKeyToken=null
......................
Any idea what i'm doing wrong?
Thanks in advance
JB