InstallUtil fails to install service; throws BadImageFormatException

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
 
P

Phil Wilson

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.
 
K

Keith

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top