All I needed to do to fix this problem was to right-click the Resources.resx
file in the Solution Explorer and click Run Custom Tool. This re-generates the auto-generated Resources.Designer.cs
file.
If the .resx file was added to the project manually, the Custom Tool property of the file must be set to “ResXFileCodeGenerator”.
The problem is due to a mismatch of namespaces, which occurs if you change the “default namespace” of the assembly in the project settings. (I changed it from (previously) "Servers"
to (now) "RT.Servers"
.)
In the auto-generated code in Resources.Designer.cs
, there is the following code:
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Servers.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
The literal string "Servers.Resources"
had to be changed to "RT.Servers.Resources"
. I did this manually, but running the custom tool would have equally well done it.