BadImageFormatException Error When Using InstallUtil Tool

I created and compiled my Windows service using .NET 4.0. So I go to the .NET 4.0 folder and say something like this: I copied the bin folder to drive C to make the path shorter:

InstallUtil.exe "C: \ bin \ Debug \ MyTestService.exe"

and this is the error I get:

An exception occurred during initialization of the installation: System.BadImageFormatException: Could not load file or assembly 'file: /// C: \ bin Debug \ MyTestService.exe' or one of its dependencies. An attempt was made to download a program with the wrong format.

Therefore, I do not know what to do.

+5
source share
3 answers

, installutil. , installutil.exe .NET 2.0, exe 4.0 32- installutil 64- dll/exe.

+16

VisualStudio "AnyCPU", Install Utility X64, , X64 . - , .

0

I am configured as AnyCPU for 32-bit and 64-bit settings. It worked.

0
source

All Articles