我可以在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 (将#修改为@)