运行我的应用程序时出现奇怪的错误消息

发布于 2024-09-10 09:39:28 字数 436 浏览 7 评论 0原文

伙计们,我在 Visual Studio 2010 中创建了一个控制台应用程序。它面向 .NET Framework 2.0。当我在 Visual Studio 中运行该应用程序时,它运行完美。然后,我退出 Visual Studio 并将可执行文件复制到我的 C:\Windows\System32 目录。当我打开命令提示符窗口并尝试执行我的程序时,它会出现一个标准的 Windows 消息框,其中包含错误消息“无法找到运行此应用程序的运行时版本”。我知道我安装了 .NET 框架。

然后,我将可执行文件复制到我的 C:\Users\Public 目录并尝试从那里执行它,效果很好。所以我假设这是某种安全问题或其他问题?我需要做什么才能使应用程序在 C:\windows\system32 目录中运行?

顺便说一句,我使用的是 Windows 7 64 位。该应用程序针对 .NET 2.0 框架和 32 位计算机进行编译。

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.

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?

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

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

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

发布评论

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

评论(1

烟花肆意 2024-09-17 09:39:28

我认为在 64 位机器上,您必须将其放入 c:\Windows\SysWOW64 中,其中包含为兼容性而保留的所有 32 位内容(system32 中的所有内容都应该是 x64)。

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).

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