System.BadImageFormatException:无法加载文件或程序加载、文件、程序、System

2023-09-07 18:10:52 作者:Rangers(流浪者)

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>InstallUtil.exe C:\_PRODUKCIJA\D
ebug\DynamicHtmlTool.exe
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.

Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\_PRO
DUKCIJA\Debug\DynamicHtmlTool.exe' or one of its dependencies. An attempt was ma
de to load a program with an incorrect format..

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>

服务的x86编译即使两台计算机都x64和它的作品在我的电脑上。在这里,在服务器里是赢得2008年我得到这个错误。

service is x86 compiled even both computers are x64 and it works on my computer. Here in server where is win 2008 i get this error.

我试着从谷歌的解决方案,但没有工作。

i try solutions from google but none works.

就像写在这里,我有86项目 http://www.davesquared.net/2008/12/systembadimageformatexception-on-64-bit.html

Like write here i have x86 project http://www.davesquared.net/2008/12/systembadimageformatexception-on-64-bit.html

推荐答案

我看来,您使用的是64位版本的工具安装32位应用程序。寻找32位版本的工具在这里:

I seems that you are using the 64-bit version of the tool to install a 32-bit application. Look for the 32-bit version of the tool here:

C:\Windows\Microsoft.NET\Framework\v4.0.30319

和它应该安装32位应用程序就好了。

and it should install your 32-bit application just fine.