如何解决我可以在Mac上使用resgen创建强类型的类吗?
我正在使用Visual Studio for Mac来处理移动应用程序项目。我需要向资源文件中添加一些字符串,并重新生成随附的强类型类。就我而言,我可以手动编辑Language.resx
XML文件以添加字符串,但我不想修改生成的Language.Designer.cs
文件。
似乎Visual Studio在后台使用了名为resgen.exe
的工具将resx文件转换为C#。基于resgen docs,这似乎需要使用/str
标志。
但是,正如我所说,我正在使用Visual Studio for Mac。当我编辑resx文件或重建项目时,似乎没有自动生成强类型的类。我在以下路径中有一个resgen可执行文件,但它不支持/str
标志。
tyler@Tylers-MBP ~ % which resgen
/Library/Frameworks/Mono.framework/Versions/Current/Commands/resgen
tyler@Tylers-MBP ~ % resgen --help
Mono Resource Generator version 6.12.0.0
Usage:
resgen source.ext [dest.ext]
resgen [options] /compile source.ext[,dest.resources] [...]
Convert a resource file from one format to another.
The currently supported formats are: '.txt' '.resources' '.resx' '.po'.
If the destination file is not specified,source.resources will be used.
Options:
-compile,/compile
takes a list of .resX or .txt files to convert to .resources files
in one bulk operation,replacing .ext with .resources for the
output file name (if not set).
-usesourcepath,/useSourcePath
to resolve relative file paths,use the directory of the resource
file as current directory.
-define,/define:SYMBOL1,SYMBOL2
takes a comma-separated list of symbols that control conditional
inclusion of resources file. The source file needs to be in
the '.txt' format.
Resources enclosed with #ifdef SYMBOL1 ... #endif directives
will be included in the destination file when SYMBOL1 has
been specified using /define option.
Resources enclosed with #if ! SYMBOL2 ... #endif directives
will be included only if SYMBOL2 has NOT been specified.
tyler@Tylers-MBP ~ %
我错过了什么吗?在Mac上是否有工具可以将resx文件转换为强类型的C#类?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。