Reputation: 736
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.
Upvotes: 47
Views: 29207
Reputation: 5136
If you're looking to automate this process you can use resgen
resgen c:\development\test\properties\resources.resx /str:csharp
Upvotes: 0
Reputation: 66
In JetBrains Rider, I had to right-click the resx file and select "Generate resources"
Upvotes: 3
Reputation: 596
When editing the resource file in Visual Studio, check the Access Modifier drop down is not set to No code generation.
If it is then select the appropriate option from the drop down - Public or Internal.
Upvotes: 13
Reputation: 9895
I had the same issue when I renamed my [YOUR_RESOURCE].resx file into [YOUR_RESOURCE].en-US.resx. It seems [YOUR_RESOURCE].Designer.cs no longer auto generates any code after you renamed the default [YOUR_RESOURCE].resx format to something like [YOUR_RESOURCE].en-US.resx
Upvotes: 1
Reputation: 449
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.
Upvotes: 12
Reputation: 7068
I came across this solution and it worked fine for me.
LastGenOutput
tag for the resource fileUpvotes: 0
Reputation: 292465
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.
Upvotes: 80