I've just come across the weirdest behavior in Visual Studio 2010 while working with Resx resource files and I just can't wrap my head around it.
The problem is as follows: Visual Studio will not generate the designer.cs
file for a resource file with a localized name (such as resource.fr.resx
), but it works fine for other files with simple names (such as resource.resx
).
Here's a snapshot of my visual studio project setup:
As you can see I just did a simple test with 3 resource files:
- test.resx
- test2.resx
- test.fr.resx
The designer.cs
files for test.resx
and test2.resx
are generated just fine. However test.fr.designer.cs
is created but always blank, no matter what I do.
I have double and triple checked: the custom tool property is properly set for the localized file. All properties are exactly the same across all files (I'm using PublicResxFileCodeGenerator
, but I get the same behavior if I set access modifier to internal and use ResxFileCodeGenerator
).
Note: I've noticed that when created a resource file, Visual Studio normally defaults the access modifier to "Internal". However, when creating a localized resource file (resource.fr.resx
) it defaults to "No code generation". Just found that interesting to note since it proves that visual Studio is treating the localized file differently for some reason.
--> Is there something I'm missing here? I would appreciate if anybody has some insight on the subject, this is driving me crazy.