Application.exe 不是有效的 Win32 应用程序错误 [英] Application.exe is not a valid Win32 application error

查看:37
本文介绍了Application.exe 不是有效的 Win32 应用程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个 Console 应用程序,客户端试图在他们的 Windows Server 2003 R2 机器 机器上运行它,但他们收到了该错误消息.

I have written a Console application that client is trying to run it on their Windows Server 2003 R2 machine machine and they get that error message.

如果我去Build ->配置 Manager 我所有的项目都设置为Any CPU"的平台和

If I go to Build -> Configuration Manager all my projects are set to Platform of "Any CPU" and Configuration of

"Release"

我还可能错过了什么?他们不想通过双击来实际运行控制台应用程序,他们想将它交给 Windows 计划任务,以便它可以在特定时间选择并运行它

What else I might have missed? They don't want to actually run the console application by double clicking on it, they want to give it to the Windows schedules tasks so it can pick it up and rn it on certain times

推荐答案

从 .NET 4.5 开始,编译器生成一个标记为仅与 Windows 6.0 及更高版本兼容的 EXE.Vista及以上.这样的可执行文件在 XP 和 Server 2003 上启动时将无法立即运行,它们是 Windows 版本 5.0.您在之前收到此错误,它可以告诉您机器上未安装 .NET 4.5.

Starting with .NET 4.5, the compiler generates an EXE that's marked to be compatible only with Windows version 6.0 and greater. Vista and up. Such an executable will fail to run immediately when started on XP and Server 2003, they are Windows versions 5.0. You get this error before it can tell you that .NET 4.5 isn't installed on the machine.

必须以 .NET 4.0 或更低版本为目标.对您依赖的任何 DLL 的相同要求,包括非托管的.在这篇博文中有更多相关信息.

You must target .NET 4.0 or less. Same requirement on any DLLs you have a dependency on, including unmanaged ones. More about this in this post.

这篇关于Application.exe 不是有效的 Win32 应用程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆