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