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
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