简体   繁体   English

我可以在C#项目上使用.rc资源文件吗?

[英]Can I use a .rc resource file on a C# project?

我在C#中有一个解决方案,我需要更新资源文件中的版本(.resx文件是xml文件),我已经在C ++资源文件(不是xml文件)中做到了,我想知道是否可以使用类似在我的C#项目中

You can't do it directly from Visual Studio. 您不能直接在Visual Studio中执行此操作。

If you invoke the csc compiler directly, you can embed a .res file using the /win32res: flag on the command line. 如果直接调用csc编译器,则可以在命令行上使用/win32res:标志嵌入.res文件。 (Use the rc tool to generate a .res from a .rc.) (使用rc工具从.rc生成.res。)

Alternatively, you could build your EXE through Visual Studio as normal, then add a post build step that invokes ildasm followed by ilasm . 另外,您可以照常通过Visual Studio生成EXE,然后添加一个后ildasm步骤,该步骤调用ildasmilasm ilasm supports the /resource= command line flag. ilasm支持/resource=命令行标志。

不,您不能,但是有一些转换方法,请参见此链接: 从Win32资源构建托管资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM