PublicResXFileCodeGenerator not generating anything

46 Views Asked by At

I want to localize my blazor server .net 8 app. I have a Resources folder with a resource.en.resx file. The Custom tool PublicResXFileCodeGenerator yields Custom tool PublicResXFileCodeGenerator failed to produce an output for input file 'Resource.en.resx' but did not log a specific error.

Yes, I know that this is sometimes a problem, hence I have tried everything suggested: unloading/reloading/restarting/cleaning/rebuilding/removing .vs folder and whatnot... Nothing seems to help.

I have the latest SDK.

[Update]

I ended up implementing my own solution... but this is just frustrating...

1

There are 1 best solutions below

1
Jonathan Rowles On

I had a similar problem this morning. I solved my issue with the below steps. Hopefully this helps.

Delete the Designer.cs File: Begin by deleting the Resource.Designer.cs file associated with your .resx file from your project.

Open the .resx File: Navigate to and open the Resource.resx file within your project.

Set the Access Modifier to 'No Code Generation': In the Properties window of the .resx file, change the Access Modifier to "No Code Generation."

Rebuild the Project: Save any changes and then rebuild your project.

Restart Visual Studio: For good luck.

Re-enable the .resx Access Modifier to Public: Open the Resource.resx file again, and this time, set the Access Modifier back to "Public."

Rebuild the Project Again: Finally, rebuild your project once more.

This sequence of steps resolved the issue of the .resx file not properly generating the Resource.Designer.cs file.