Resource Files & globalization

  • Thread starter Thread starter John Stemper
  • Start date Start date
J

John Stemper

Getting resource files to work with VS2002 and ASP.Net seems to be a little
flaky. I've added a resource file "strings.resx" to the project. The
properties of the files say Build action = "embedded resource". I've added
the appropriate code to the Global.asax:

protected void Application_Start(Object sender, EventArgs e)
{
Application["CM"] = new
ResourceManager("strings",Assembly.GetExecutingAssembly());
}

I've added the following code to my app:

ResourceManager rm = (ResourceManager) Application["CM"];
dgResults.Columns[1].HeaderText=rm.GetString("Name");


This builds fine but when I try and run it I get the error:

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

Any suggestions or good articles would be appreciated.


Thanks

John
 
Hi John,

Based on my research and experience, the following information is useful to
you. Please refer to it carefully.

ResourceManager and ASP.NET
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptutorials
/html/resourcemanager_and_asp_net.asp

Working with Resource Files
http://samples.gotdotnet.com/quickstart/aspplus/doc/resourcefiles.aspx

How to read satellite assemblies resources in ASP.NET
http://www.codeproject.com/aspnet/SatResourcesDemo.asp

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top