InstallUtil and BadImageFormat with a normal C# service

So, you get the old BadImageFormat error when installing your service. If you aren’t writing C++ extensions, then this is probably because you forgot to use the right version of InstallUtil for your target platform.

i.e. x86 build using x64 InstallUtil or vice versa.

Easiest fix? Just build for Any CPU. Then you really don’t have to think about it too hard.

Happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked *