Change access modifier of .resx to public

Completed

Ahoi *,

I created a WPF application with Rider and I want to do my localization with resx. So, due to the solved issue https://youtrack.jetbrains.com/issue/RIDER-3108 it is possible to manually edit the .resx file and have the changes directly compiled to the .Designer.cs (Using a Designer like in VS would be preferred, but this is a know issue (see https://rider-support.jetbrains.com/hc/en-us/community/posts/115000356670-Designer-for-Resource-Files?input_string=Change%20access%20modifier%20of%20.resx%20to)).

BUT, what actually doesn't work, is that the resx only uses the ResXFileCodeGenerator, not the PublicResXFileCodeGenerator.
See picture:

 

This leads to have the access modifier of the .Designer.cs of internal, but I need public to make the localization work. How can I achieve that?

Thanks a lot for help!

3
3 comments
Avatar
Permanently deleted user

Solved it!

if anyone else runs into this problem, here is how to solve this:

- edit the .csproj file manually (context menu on project in Solution Explorer > Edit > Edit '<name>.csproj')
- search for the embedded resource tag that includes the Resources.resx file
- Change Generator child tag content to 'PublicResXFileCodeGenerator'
- save and enjoy


7

Or you can do it easily in VisualStudio ;)

-3

Hello
Eric's tip did not completely solve the problem for me.
I had to manually change the access modifier in the corresponding resource file (*.Designer.cs) from "internal" to "public" for already existing translations.

Probably you can also change the setting in the properties of the RESX file from "ResXFileCodeGenerator" to "PublicResXFileCodeGenerator". Then you don't have to edit the csproj file manually.

Nevertheless, many thanks to Eric for pointing out the way.

2

Please sign in to leave a comment.