navigation
 Friday, July 13, 2007

Like many developers, I have both VS2003 and VS2005 installed on my machine. I had also placed a shortcut to the Visual Studio  command prompt in my programs menu. A couple of days ago, I had the opportunity to write my first Windows service application. I got everything set the way I wanted, and it was time to install. So, I opened up the VS command prompt, and typed in the magic chant "installutil servicename.exe". And fairly promptly got the error "Exception occurred while initializing the installation: System.BadImageFormatException: the format of the file 'servicename.exe' is invalid...".

If you're encountering the same error, make sure that you're using the correct installer. For me, it turned out that I was using the VS2003 installer. As soon as I switched to the installer from VS2005 (using the correct command prompt), everything worked just fine. It took me a while to track this down - perhaps this will save you some time.

Thursday, August 14, 2008 9:18:17 AM UTC
thanks for your tip; my problem is a different thing, but it's also related to installutill, I constracted my rist windows service by following the steps in a blog which i found in the net, but whenI finished and tried to install it using visula studio 2005 command prompt, i got the message: 'installutil' is not recognized as internal or external command, operable porgram or batch file.
can you help me in this because I don't know what to do, and by the way I am admin on my computer, because it was written in the bblog that I should be admin to use installutil
mahmoud
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, i, strike, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview