Problem with globalizing web application

  • Thread starter Krzysztof Swiezynski
  • Start date
K

Krzysztof Swiezynski

Hello,
I've made a simple web application which display a welcome string based
on the choosen language selected (values: "pl" or "en") from a
DropDownList. My code is:

protected ResourceManager gStrings;

private void Page_Load(object sender, System.EventArgs e)
{
gStrings = new ResourceManager("ResTest.ResTest",
System.Reflection.Assembly.GetExecutingAssembly(),null); }

private void DropDownList1_SelectedIndexChanged(object sender,
System.EventArgs e) {
string lang = DropDownList1.SelectedValue; // pl or en
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(lang);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
welcomeLabel.Text = gStrings.GetString("Welcome");
}
}

all code is in the ResTest namespace.

In a root directory a I've three resx files:
ResTest.resx
ResTest.en.resx
ResTest.pl.resx

each file contains "Welcome" key with a specific value.

after building in my application bin directory "pl" and "en" directories
are created.
When I run my application locally there is no problem with it. "Welcome"
strings are displayed correctly based on the language choosen from the
dropdownlist.
But when I deploy my application on the product server, after choosing
the language from the dropdownlist I receive the following error:

Could not find any resources appropriate for the specified culture (or
the neutral culture) in the given assembly. Make sure
"ResTest.ResTest.resources" was correctly embedded or linked into
assembly "ResTest". baseName: ResTest.ResTest locationInfo: <null>
resource file name: ResTest.ResTest.resources assembly: ResTest,
Version=1.0.1934.19000, Culture=neutral, PublicKeyToken=861099a70d6190ca

I've read more articles about it and I consider that my code looks fine.
I don't know how to resolve my problem :(. I try to strong sign the
assembly but the effect is the same. Colud You help me ?. I think that
this is a server problem because my app works fine on my local machine
but I don't know what to do.

Thank You in advance.

Regards

Krzysztof Swiezynski
 
K

Karl Seguin

K

Krzysztof Swiezynski

Karl said:
Are you sure all satellite assemblies have been properly deployed?

I think so. I've deployed my application using copy project in Visual
Studio and then I try to manually copy tha application.
Is the root namespace of your project ResTest?

I'm sure.

Krzysztof.
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top