我在 VS.Net 2010、Windows 7 64 位中生成资源时遇到问题。它能够在 Visual Studio 中编译解决方案。但是,当我尝试使用 msbuild 在命令提示符下编译解决方案时,它无法生成资源。
我浏览了下面的链接并找到了一个解决方案,可以使用 msbuild 在命令提示符下对其进行编译。
http://blogs.msdn.com/b/visualstudio/archive/2010/06/19/resgen-exe-error-an-attempt-was-made-to-load-a-program- with-an-in Correct-format.aspx
我使用了上面文章中的选项 2。
在命令提示符下编译之前,我必须执行以下两个命令。
CorFlags /32BIT+ /Force Resgen.exe
set RESGENTOOLARCHITECTURE=Managed32Bit
完成编译后,我必须执行以下删除 32 位命令。否则它在视觉工作室中会失败。
CorFlags /32BIT- /Force Resgen.exe
一件奇怪的事情是我的团队成员对此没有任何问题。我只有这个问题。
你能告诉我为什么只有我一个人这样吗?
如果有的话,还有任何其他永久解决方案,而无需一次又一次运行上述命令。
提前致谢
I am having an issue generating resources in VS.Net 2010, windows 7 64bit. It am able to compile the solution in Visual studio. But when I try to compile the solution in command prompt using msbuild, it fails generating the resources.
I went through the below link and find a solution to get it compiled in command prompt using msbuild.
http://blogs.msdn.com/b/visualstudio/archive/2010/06/19/resgen-exe-error-an-attempt-was-made-to-load-a-program-with-an-incorrect-format.aspx
I used option 2 from the above article.
Before compiling in command prompt I have to execute the below two commands.
CorFlags /32BIT+ /Force Resgen.exe
set RESGENTOOLARCHITECTURE=Managed32Bit
And after finishing the compilation I have to execute the below remove 32 bit command. Other wise it fails in visual studio.
CorFlags /32BIT- /Force Resgen.exe
One weird thing is non of my team members are having any issue with this. I only have the problem.
Could you please let me know why it's only me?
Also any other permanent solution if you have, with out running the above commands again and again.
Thanks in Advance
发布评论
评论(1)
有时它会出现特权问题。
只需确保您已尝试以完全权限运行命令提示符即可。
即以管理员身份运行
Sometimes it has issues with the privileges.
Just make sure that you have tried running your command prompt with full privileges.
i.e. Run as administrator