InstallUtil fails to install service; throws BadImageFormatException

  • Thread starter Thread starter Keith
  • Start date Start date
K

Keith

Hello,

I'm trying to use InstallUtil to install a Windows Service, but it keeps
failing with a BadImageFormatException. I don't understand what it wrong
with it; all the code has been generated by Visual Studio. I started a new
Windows Service C# project, added an installer in the designer, and built it
without errors. But when I tried to install it with InstallUtil, it fails.

Am I missing an override or not implementing something else that is
required? None of the tutorials that use InstallUtil to register their
service mention anything about that...

Any help is appreciated!

Keith
 
I bet you're using a 1.1 InstallUtility to install a 2.0 assembly, something
like that. BadImageFormatException is what you get when a 1.1 assembly tries
to load a 2.0 assembly.
 
Phil Wilson said:
I bet you're using a 1.1 InstallUtility to install a 2.0 assembly,
something like that. BadImageFormatException is what you get when a 1.1
assembly tries to load a 2.0 assembly.

Ha!

You are the winner, Phil. I just noticed the version string that gets
printed out to the console. I guess I'll need to cleanup/reorder my paths
so I don't keep getting 1.1 utils when I want 2.0 ones.

Thanks.

Keith
 
Back
Top