S
Steven Berkovitz
Hi there,
I am having a very odd problem with localization. I have a web app with 2 embedded resources files - 1 neutral .resx file and 1 for fr-CA. With <identity impersonate="true" /> the resources from the french assembly do not load and it defaults to the neutral resources. If I comment out the <identity ... /> line they work fine. I have given EVERYBODY full control to the entire directory structure.
I am using the following lines of code to set the culture on the thread in global.asax.cs (for testing purposes)
protected void Application_BeginRequest(Object sender, EventArgs e)
{
string lang = Request.QueryString["lang"];
string culture = "en-US";
if(lang != null)
{
switch(lang.ToLower())
{
case "f":
culture = "fr-CA";
break;
default:
culture = "en-US";
break;
}
}
CultureInfo c = new CultureInfo(culture);
System.Threading.Thread.CurrentThread.CurrentCulture = c;
System.Threading.Thread.CurrentThread.CurrentUICulture = c;
}
And to load up the resources I am using:
ResourceManager rm = new ResourceManager("Spc.Websites.Static.Resource", Assembly.GetExecutingAssembly());
Literal1.Text = rm.GetString("display");
Any help would be greatly apprecaited!
-Steven
I am having a very odd problem with localization. I have a web app with 2 embedded resources files - 1 neutral .resx file and 1 for fr-CA. With <identity impersonate="true" /> the resources from the french assembly do not load and it defaults to the neutral resources. If I comment out the <identity ... /> line they work fine. I have given EVERYBODY full control to the entire directory structure.
I am using the following lines of code to set the culture on the thread in global.asax.cs (for testing purposes)
protected void Application_BeginRequest(Object sender, EventArgs e)
{
string lang = Request.QueryString["lang"];
string culture = "en-US";
if(lang != null)
{
switch(lang.ToLower())
{
case "f":
culture = "fr-CA";
break;
default:
culture = "en-US";
break;
}
}
CultureInfo c = new CultureInfo(culture);
System.Threading.Thread.CurrentThread.CurrentCulture = c;
System.Threading.Thread.CurrentThread.CurrentUICulture = c;
}
And to load up the resources I am using:
ResourceManager rm = new ResourceManager("Spc.Websites.Static.Resource", Assembly.GetExecutingAssembly());
Literal1.Text = rm.GetString("display");
Any help would be greatly apprecaited!
-Steven