473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ResourceManager strange behavior

Hi,

I've created a test aspnet web application which contains one page only.
There is only one label control placed on the page.

The text of the label control is set on server side by the PageLoad method.
The text is stored into a sattelite assembly.

This is the code which sets the text:

CultureInfo ci = new CultureInfo("de-DE");

Thread.CurrentThread.CurrentCulture = ci;

Thread.CurrentThread.CurrentUICulture = ci;

ResourceManager rm = new ResourceManager("WebApplication6.Resources",
Assembly.GetExecutingAssembly());

this.Label1.Text = rm.GetString("test");

Running the app the German text is set as expected.

Now.. the strange behavior.

If I add the element

<identity impersonate="true"/>

to the config file the resource manager fails loading the corrext text. The
german text is not found anymore and the text for the default language is
loaded.

Do you know why it happens? Is there anything I miss?
Nov 19 '05 #1
1 1172
Hi Mircea,

Welcome to ASPNET newsgroup.
As for the accessing localized resource in satellite assembly problem you
mentioned, it is a well-known issue which is indeed caused by the
impersonation. The reason only default culture's resouce is loaded and
other specific cultures' can't be loaded is as below:

Loading the resource in satelitte dll will cause them to be shadow copied
to the temporary asp.net files folder. This will be done using the
Impersonation token if impersonation is being used. If not, then it will
use the process identity. Usually, the error is caused by the impersonated
identity not having permissions to write to the Temporary ASP.NET files
folder.

So as for your scenario, it seems the client user which is impersonated
didn't have the proper permission. There're two options:
1. Turn off imperonate and using the process identity to run asp.net , by
default is NetworkService account which will have the sufficient pemission
to access ASPNET temporary folder.

2. Granting the impersonated account the sufficient permission to the
temporary asp.net folder. I don't think this is a good idea since you may
have multi-client users in your app and it's hard to ensure that all those
accounts have the proper access control over the temp dir. Also, in
addition to this, impersonating a weak permited account may cause some
other unexpected error.

If there are anything else 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.)


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nils Erik Asmundvaag | last post by:
Hello I hope someone is able to help me with this frustrating problem. I have a C# web project in Visual Studio .NET 2003. I want to support Swedish and Norwegian texts and have put the texts...
3
by: Craig | last post by:
Hi I'm creating a web control whereby I use a resource file to store strings for property descriptions and so forth. The namespace for the control is: Unsd.Web.WebControls all classes in the...
0
by: the_medeiros | last post by:
How i can use resources files to show display messages ??? I try use: private static ResourceManager resourceManager = new ResourceManager(typeof(ExceptionManager).Namespace +...
0
by: Weenie the Pooh | last post by:
We are writing an ASP.Net C# application (VS 2003) and plan to use embedded resources files for french, german and english UI. I created resx files named _todo.resx and _todo.fr-CH.resx Here...
0
by: steven | last post by:
I have an asp.net webapp running on W2K server with .net framework 1.1 The intranet-app supports 2 languages: dutch (fallback language) and french. The choice is made with 'Request.UserLanguages'...
0
by: Ricardo Corsi | last post by:
Hi, I have a websystem (ASP.Net -VB) that uses a resourceManager to swicth between 3 diferent languages. Inside my network, My applicattion works very nice. But, when i try to run outside my...
4
by: Peter | last post by:
Hi! I'm developing components (webparts) for a sharepoint site and are currently having some problems with the resource manager. The site supports two languages (English and Swedish) and when...
1
by: Franz | last post by:
I know how to use ResourceManager, but I think I don't use it wisely. I have a web user control. Inside the control, I need to call ResourceManager.GetString. However, I also need to call...
2
by: ngrover | last post by:
When accessing strings from a french language utf-8 .txt file (that has been resgen'ed into a .resources file) via ResourceManager.GetString() method, I am encountering a problem. All the special...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.