[英]Can't run Visual Studio 2012 program on Windows XP
I have a simple C# console application built using Visual Studio 2012 and .NET 4.5. 我有一个使用Visual Studio 2012和.NET 4.5构建的简单C#控制台应用程序。
When I build the solution on my 64 bit Windows 7 machine and then copy the MyProgram.exe file from this location: 当我在64位Windows 7计算机上构建解决方案,然后从此位置复制MyProgram.exe文件时:
C:\\Users\\me\\Desktop\\MyProgram\\MyProgram\\bin\\x86 C:\\用户\\我\\桌面\\ MyProgram \\ MyProgram \\ BIN \\ X86
to a Windows XP machine, and then try to run the MyProgram.exe file, I get the following error: 到Windows XP机器,然后尝试运行MyProgram.exe文件,我收到以下错误:
MyProgram.exe is not a valid win32 application
I can see by just Googling the problem that lots of other people have the same issue and there are many suggested solutions. 我只能谷歌搜索问题,许多其他人有同样的问题,并有许多建议的解决方案。 But none of the solutions seem to help me.
但是这些解决方案似乎都没有帮助我。
Can someone please give me step-by-step instructions for how to prepare the .exe file to run on XP? 有人可以给我一步说明如何准备.exe文件在XP上运行吗?
The steps I used (without creating a new project): 我使用的步骤(没有创建新项目):
That's it. 而已。
Remember to also set the Publish (one-click) setting under "Prerequisites" to use Framework 4, if you're using the publish feature. 如果您正在使用发布功能,请记住还要将“先决条件”下的“发布(一键)”设置设置为使用框架4。 I found the client version of the framework doesn't seem to cut it, you need the full version despite what the documentation seems to indicate, but maybe that's on a project-by-project basis.
我发现框架的客户端版本似乎没有削减它,你需要完整版本,尽管文档似乎表明,但也许这是在逐个项目的基础上。
I finally got it to work!! 我终于开始工作!! All this time trying to figure out how to fix the problem and the solution was having to recreate the entire project from scratch.
这一直试图弄清楚如何解决问题,解决方案是必须从头开始重新创建整个项目。
For anyone is this same situation, save yourself the time and headache and do the following: 对于任何人都是同样的情况,节省时间和头痛,并做以下事情:
Programs compiled in Windows Vista and later cannot be run in Windows XP. 在Windows Vista及更高版本中编译的程序无法在Windows XP中运行。
http://blogs.msdn.com/b/vcblog/archive/2012/06/15/10320645.aspx
You need to set the compiler to VC2010, and make sure you compile in 'release' mode to make sure the program can be run in another machine. 您需要将编译器设置为VC2010,并确保在“释放”模式下编译以确保程序可以在另一台机器上运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.