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

穿精又带淫゛_ 提交于 2019-12-20 04:12:42

问题


I have a solution in C# and i need to update the version in the resource files (.resx files are xml files), i already did it in C++ resource files (not xml files) and I want to know if I can use something like that in my C# project.


回答1:


You can't do it directly from Visual Studio.

If you invoke the csc compiler directly, you can embed a .res file using the /win32res: flag on the command line. (Use the rc tool to generate a .res from a .rc.)

Alternatively, you could build your EXE through Visual Studio as normal, then add a post build step that invokes ildasm followed by ilasm. ilasm supports the /resource= command line flag.




回答2:


No you can't, but there are some ways to convert, see this link: Building Managed Resources from Win32 Resources



来源:https://stackoverflow.com/questions/4390463/can-i-use-a-rc-resource-file-on-a-c-sharp-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!