I need to be able to load resources at runtime and have used the following code in a simple C# test app :-
ResourceManager rm = new ResourceManager("ResourceTest.Resources", this.GetType().Assembly);
string someString = rm.GetString("MyString");
label1.Text = someString;
When I try to run the app, the call to GetString() on the second line of code throws a MissingManifestResourceException.
However, if I add a new Resource file to the project by right clicking the project node in the Solution Explorer and select Add | New Item | Resource File I get a new res file called, by default, Resource1.resx. I can then reference this file in the above code (changing the first param in the ResourceManager contructor to "ResourceTest.Resource1") and all works fine.
How come the default Resource file in the project won't work but any resource file I add will ?
BTW, I am using Visual Studio 2005 if it makes any difference ??
Thanks
Alan