Satellite assembly resources won't load if identity impersonate=true

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
 
S

Steven Cheng[MSFT]

Hi Steven,

Welcome to ASP.NET newsgroup.
As for the problem you mentioned, I think you're encountering a common
issue on asp.net's runtime assembly shadow copy. ASP.NET will shadow copy
all the private assemblies deployed in bin folder to the temporary asp.net
folder so that rutnime won't lock the orginal deployed ones. However, when
we using impersonate, the impersonated user account may haven't the
sufficient permission to create/modify file in the ASP.NET's temporary
folder, then the satellite one will be failed to copy to temporary dir.
So currently I suggest you first try using the filemon tool to monitor the
file/folder accessing status when running your asp.net app to confirm this
problem. And then adjust the proper permission for your impersonated
account according to the monitor result.

If there're anything unclear, please feel free to post here. Thanks,

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top