Search code examples
wpfvisual-studioresourcescode-generationresx

The code-generation of my .resx resource stop working


Normally when we add new rows to a .resx file, say Resources.resx, in the IDE's resource editor, the code-behind file, say Resources.Designer.cs, will be automatically updated - adding new properties for the new rows.

But in my situation, that automation has stopped working. Have you met the same problem? If you do, please help me to get .resx back to work :)

Thank you!


Solution

  • Here what I found that works:

    1. Delete the Resources.Designer.cs file

    2. In Solution Explorer, exclude the Resources.resx

    3. Then, show all files, re-include the Resources.resx. The Resources.Designer.cs file should be recreated then.

    4. Reset the 'Access Modifier' to be 'Public' (see details here)

    5. Right click Resources.resx in Solution Explorer and click Run custom tool

    Hope this would be helpful to you!