Resource (RESX) files messed up

I had the same problem - Designer.cs file not being present for some resx files.

The fix was to set the properties for the resx files:

Build Action - Embedded Resource
Custom Tool  - PublicResXFileCodeGenerator

This is what ASP.NET documentation says about resources files.

It does not talk specifically about codebehind designer files generated on the fly but if you read the bolded text carefully, it is essentially saying that you need the base file without language specified and, given that, it makes sense that only this file will include autogenerated code.

"When you create resource files, you start by creating a base .resx file. For each language that you want to support, create a new file that has the same file name. But in the name, include the language or the language and culture (culture name). For a list of culture names, see the CultureInfo class. For example, you might create the following files:

•WebResources.resx

The base resource file. This is the default (fallback) resource file.

•WebResources.es.resx

A resource file for Spanish.

•WebResources.es-mx.resx

A resource file for Spanish (Mexico) specifically.

•WebResources.de.resx

A resource file for German."

I actually have never noticed this before but when I went to check my old projects, I saw they all have the base file and then language specific ones. So I just corrected it to follow that convention and it works now.


If I were you, I would:

create a new resx file; open the old one; Press ctrl+a in the old one; Press ctrl+v in the new one; Save the new one; Delete the old one; Rename the new one :)

This should solve the problem quiet fast. You could also check if the cs files are not excluded from the file by clicking the show all button