我运行应用程序时奇怪的错误信息错误信息、应用程序、奇怪

2023-09-06 23:44:27 作者:执青灯望长安

大家好,我创建在Visual Studio 2010中的控制台应用程序它面向.NET Framework 2.0。当我运行应用程序的Visual Studio,它可以完美运行。然后我退出Visual Studio和复制可执行文件到我的C:\ Windows \ System32目录。当我打开一个命令提示符窗口,并尝试执行我的程序,它与一个错误一个标准的Windows消息框,上面写着无法找到一个版本的运行时运行此程序。我知道我安装了.NET Framework。

Guys I created a console application in Visual Studio 2010. It targets the .NET framework 2.0. When I run the application is Visual Studio, it works perfect. I then exited Visual Studio and copied the executable to my C:\Windows\System32 directory. When I open a command prompt window and try to execute my program, it comes up with a standard Windows message box with an error that says "Unable to find a version of the runtime to run this application". I know I got the .NET framework installed.

我然后复制可执行文件到我的C:\用户\ Public目录,并试图从那里执行它,它工作得很好。所以我假定这是某种形式的安全问题还是什么的?什么我需要做的从C应用工作:\ Windows \ System32目录

I then copied the executable to my C:\Users\Public directory and tried to execute it from there and it worked fine. So I am assuming this is some kind of security issue or something? What do I need to do make the application work from C:\windows\system32 directory?

我使用Windows 7 64位,顺便说一句。该应用程序被编译为目标.NET 2.0框架和32位的机器。

I am using Windows 7 64-bit, by the way. The application was compiled to target .NET 2.0 framework and 32-bit machines.

推荐答案

我觉得一个64位的机器上,你必须把它放到 C:\ WINDOWS \ SysWOW64中,它包含了所有32位的东西保留兼容性(一切都在SYSTEM32应该是64)。

I think on a 64-bit machine you'll have to put it into c:\Windows\SysWOW64, which contains all the 32-bit stuff retained for compatability (everything in system32 should be x64).