Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding new strings to resource.resx not reflecting into Designer.cs

Tags:

c#

resx

I am adding two new strings to our resource.resx but these newly added resources(strings) are not reflecting into the auto-generated Designer.cs file. I have rebuilt the project and also tried clean+build the project but no luck! I have other resource files to support various international languages where also i need to these two new string resources

Please suggest.

like image 903
sandy Avatar asked May 12 '14 09:05

sandy


People also ask

How do I add a new line in Resx?

Answers. You can also use Shift + Enter in the resource editor...

How do I add a new line to a resource file?

Use Shift + Enter to insert a new line.


2 Answers

Make sure the Custom tool property for your resx file is set to ResXFileCodeGenerator or PublicResXFileCodeGenerator. The .Designer.cs file should be regenerated every time you modify the resx file; if it's not, you can force it by selecting Run custom tool in the context menu for the resx file.

like image 71
Thomas Levesque Avatar answered Oct 18 '22 17:10

Thomas Levesque


Right click the resx file in solution explorer, select "Run custom tool".

This generated/added the code in the .designer.cs file for the new strings in the resource file for me.

like image 41
tonyb Avatar answered Oct 18 '22 18:10

tonyb