在 VS.Net 2010、Windows 7 64 位中生成资源时出现问题

发布于 2025-01-05 18:29:50 字数 871 浏览 2 评论 0 原文

我在 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不忘初心 2025-01-12 18:29:50

有时它会出现特权问题。

只需确保您已尝试以完全权限运行命令提示符即可。

即以管理员身份运行

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文