Forms localisation oddity

C

Clive Dixon

I have two forms in an assembly that I am localising. Both source files lie
in a project subfolder Forms\Addresses (mirrored in the disk directory
structure). When I localise form A and compile, the resource (output in the
obj directory, and in the compiled assembly as confirmed using ildasm) is
called "Namespace.A.resources", and the resource is correctly loaded at
runtime by the resource manager created by the designer generated code:
new System.Resources.ResourceManager(typeof(A)).

However form B is compiled into a resource
"Namespace.Forms.Addresses.B.resources", and not surprisingly the resource
is not found at runtime.

I can see nothing whatsoever in the .cs, .resx or .csproj files or project
settings which could account for the differing compilation behaviour for
these two resources which both lie in the same project and disk folder. Has
anybody come across this problem and found the solution?
 
C

Clive Dixon

Have found cause of the problem:

The source file for form B had an enum definition within it as well as the
form class definition. While this was present, the resource file name was
incorrectly generated. On removing it, it is correctly generated. A Visual
Studio bug, in other words.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top