https://forums.xamarin.com/discussion/87175/not-able-to-use-resgen-on-mac-to-generate-cs-strongly-types-resource-class-file
https://docs.microsoft.com/en-us/dotnet/framework/tools/resgen-exe-resource-file-generator
Unfortunately resgen.exe for mono and normal resgen.exe are different software - I can not generate the AppResources.Designer.cs file in Linux.
It doesn't work:
<EmbeddedResource Include="Resx\AppResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
And I can't say why.
Interesting that msbuild can generate that file for Droid project (strings.xml), but not for PCL.
Solution:
https://msdn.microsoft.com/ru-ru/library/system.resources.tools.stronglytypedresourcebuilder(v=vs.110).aspx
modify the result .cs:
sed -i 's/using System;/using System;\n using System.Reflection;\n/g' AppResources.Designer.cs
sed -i 's/typeof(AppResources).Assembly/typeof(AppResources).GetTypeInfo().Assembly/g' AppResources.Designer.cs
It works when I put the AppResources.resx in the root directory of PCL, but if I use other directory, then it may not work. I have no time today to figure out how to configure it if it possible.
P.S. For myself - other related links to review:
( https://dzone.com/articles/missing-reswfilecodegenerator )
http://reswcodegen.codeplex.com/
https://github.com/christianhelle/reswcodegen
https://www.codeproject.com/Articles/13830/Extended-Strongly-Typed-Resource-Generator
http://www.linuxonly.nl/docs/49/145_Run_custom_tool_on_each_resx_file_when_building.html
https://stringresourcetool.codeplex.com/SourceControl/latest
https://marketplace.visualstudio.com/items?itemName=JohnAaronNelson.ForceCode (?)
https://marketplace.visualstudio.com/items?itemName=EZSlaver.ExtendedStronglyTypedResourceGenerator (source code exists)
http://blog.baltrinic.com/software-development/dotnet/t4-template-replace-resxfilecodegenerator
Interesting:
https://forums.xamarin.com/discussion/58542/resx-localization-not-working-on-real-devices
To answer:
https://forums.xamarin.com/discussion/80627/can-i-generate-resource-designer-cs-programatically
https://forums.xamarin.com/discussion/86800/is-there-any-way-to-generate-designer-cs-files-from-command-line
Немає коментарів:
Дописати коментар