System.BadImageFormatException when installing service

后端 未结 3 510
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 14:14

I am getting below exception when I try to run installer to set up service:

# ./InstallUtil ../../../../Applications/GasPosApp/bin/Wrapper.exe -s ../../../
.         


        
3条回答
  •  情话喂你
    2020-12-29 15:03

    This is often an indication of a mismatch between 32 and 64 bit. For instance if Wrapper.exe is compiled as x86 and you install it using the 64 bit InstallUtil the process cannot load the 32 bit Wrapper.exe assembly and will throw a BadImageFormatException.

    The solution is to use the 32 bit InstallUtil placed in the Framework (not Framework64) subfolder of the .NET folder (e.g. C:\Windows\Microsoft.NET\v4.0.30319\Framework if you are using .NET 4 or 4.5).

提交回复
热议问题