如何解决“%1 不是有效的 Win32 应用程序”?
环境:
Windows Server 2003 R2 企业版 64 位,SP2
.NET Framework 应该已安装(2.0 SP2、3.0 SP2、3.5 SP1)
我说“应该”是因为它们在“添加/删除程序”下列为已安装。 我不确定它是否安装正确,因为“ASP.NET”选项卡未添加到 IIS 中的任何站点。
在 IIS Web 服务扩展部分,我有“ASP.NET v2.0.50727”(允许)和“ASP.NET v2.0.50727(32 位)”(禁止)。
相关站点已启用脚本执行。
问题:
我创建了一个超级简单的 ASP.NET/C# 网站:带有标签 id="Label1" 的 Default.aspx,以及一个隐藏代码:Label1.text = "Hello World";
我得到的错误是:
%1 不是有效的 Win32 应用程序。
Environment:
Windows Server 2003 R2 Enterprise 64bit, SP2
.NET framework is supposedly installed (2.0 SP2, 3.0 SP2, 3.5 SP1)
I say "supposedly" because they are listed as installed under Add/Remove programs. I'm not sure it's properly installed, because the "ASP.NET" tab isn't added to any of the sites in IIS.
In the IIS Web Service Extensions section, I have both "ASP.NET v2.0.50727" (Allowed), and "ASP.NET v2.0.50727 (32-bit)" (Prohibited).
The site in question has script-execute enabled.
Problem:
I created a super-simple ASP.NET/C# website: Default.aspx with a label id="Label1", and a code-behind with: Label1.text = "Hello World";
and the error I'm getting is:
%1 is not a valid Win32 application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您是否尝试过
从命令行运行:?
Have you tried running:
from the command line?
另请检查您的应用程序池。 在64位环境中,您可能需要在高级设置中设置“启用32位应用程序”。
Also check your application pool. In a 64-bit environment, you may need to set "Enable 32-bit applications" in Advanced Settings.
我遇到“%1 不是有效的 Win32 应用程序”。 错误消息,因为我的 PATH 环境变量也被搞乱了。 它包含来自 python 安装的垃圾:
I had "%1 is not a valid Win32 application." error message because my PATH environment variable was messed up as well. It included this garbage from a python install:
我遇到“%1 不是有效的 Win32 应用程序”。 错误消息,因为我的 PATH 环境变量被搞乱了。 嗯,更具体地说,PATH 本身没有任何问题。 相反,我不小心创建了一个名为“C:\Program”的文件,而不是“C:\Program Files\”用于路径查找。
意外创建“C:\Program”是由于在命令行上为C:\Program Files\test.txt(不带引号)调用Notepad++的结果,因此Notepad++认为我正在尝试编辑一个名为“C: \Program”并为我创建了该文件。
I had "%1 is not a valid Win32 application." error message because my PATH environment variable was messed up. Well, more specifically, the PATH itself had nothing wrong with it. Instead, I had accidentally created a file named "C:\Program" that was used instead of "C:\Program Files\" for path lookup.
The accidental creation of "C:\Program" was a result of calling Notepad++ on the command line for C:\Program Files\test.txt (without quotation marks), so Notepad++ thought I was trying to edit a file called "C:\Program" and created the file for me.
我在 Windows Server 2008 64 位上的 IIS7 上也遇到了类似的错误。
融合日志在这里没有任何帮助,事实证明,在我的例子中,有一个第三方程序集引用了仅 32 位的程序集或本机 dll。 (非常准确)
要查找 64 位运行时正在加载哪个程序集:
请记住,放置在 bin 目录中的所有程序集都会被加载,无论它们在应用程序中的实际含义如何。
I had a similar error with IIS7 on Windows Server 2008 64 Bits.
The fusion log is not of any help here, and it turned out that in my case there was a third party assembly that was referencing a 32 Bits only assembly or native dll. (Xceed to be precise)
To find which assembly is being loaded by the 64 bits runtime :
Remember that all assemblies placed in the bin directory are loaded, regardless of their actual implication in the application.
我遇到了这个问题。 我将 .EXE 部署到不支持 .NET 4.5 的 Windows 2003。 我用 .NET 4 重建了程序并且它有效。
I had this problem. I deployed an .EXE to a Windows 2003 that doesn't support .NET 4.5. I rebuilt the program with .NET 4 and it worked.