开发者

The code-generation of my .resx resource stop working

开发者 https://www.devze.com 2023-01-29 04:50 出处:网络
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 - a开发者_StackOverflow

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 - a开发者_StackOverflowdding 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!


A very similar problem arises with aspx/ascx files. This involved deleting the designer and then clicking "convert to web application" to force code gen of the designer again. Don't know if a similar facility exists for the resx.


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!

0

精彩评论

暂无评论...
验证码 换一张
取 消