ResX provider: create resource manager directly without needing VS studio or resgen to generate designer files#337
Conversation
… (addresses an issue where resource classes are not created).
|
@tracerco-peter can you please also attach a simple translated "Hello World" application in the tests folder. |
|
added HelloWorld.NoDesignerFiles test. It's a copy of the original project with the designer.cs files removed and the 'ResXFileCodeGenerator' custom action removed from the Ressourcen.resx (to prevent VS from generating them again) |
|
I was just about to write code myself, but then I found this MR. Is there anything blocking this from getting merged (and, ultimately, released through NuGet at some point)? I'm not running |
|
@tracerco-peter @BhaaLseN sorry I was the last moths very busy with other topcis. I will follow up |
|
@Karnah the PR LGTM, can you please review from your side, if you spot any risks |
In an application I am working on my team have created a tool to extract localizable xaml properties and generate resx files automatically. The issue we have is that our tool is generating the resx files outside of Visual Studio. This means that the ResXFileCodeGenerator custom tool is not executed by Visual Studio (unless we run Resgen.exe manually or open each of the generated files in Visual Studio).
The library is making an assumption that the strongly-typed resource class (generated by ResXFileCodeGenerator custom tool in VS or by Resgen.exe) will exist. The assembly will still contains the actual .resources file despite these tools not being ran but the library will not load the resources, as the type can't be found. From the assembly name and dictionary name we can attempt to create a new resource manager manually by assuming that if if we have a .resources file embedded in the assembly which matches the assembly name + dictionary name then we can attempt to manually create an instance of it.