System.BadImageFormatException: Could not load file or assembly

senzacionale picture senzacionale · Mar 8, 2011 · Viewed 408.8k times · Source
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>

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.

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

Answer

madd0 picture madd0 · Mar 8, 2011

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

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

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