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.
source
share