Groups | Blog | Home
all groups > dotnet general > december 2005 >

dotnet general : Installutil System.BadImageFormatException



Installutil System.BadImageFormatExcepti
12/3/2005 1:56:02 PM
I've tried to make a Windows Service using the 2005 C# and when I go to use
Installutil it returns with an System.BadImageFormatException error while
intializing the installation. I've even gone as far as creating a service
with 2003 C# that Installutil works with with then I try to upgrade the 2003
project to 2005 and then I start getting the excpetion again. Is there a
Phil Wilson
12/4/2005 10:26:49 AM
That message is what happens when a 1.1 assembly tries to load a 2.0
assembly. Look at the launch conditions and make sure your SupportedRuntimes
starts with 2.0 - the documentation says:

"Note If your deployment project includes custom actions that have a
dependency on the .NET Framework, the first version found (in the order
listed) will be loaded to run the custom action. For this reason, you should
list the most recent version first. "
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"Installutil System.BadImageFormatExcepti" <Installutil
[quoted text, click to view]

Phil Wilson
12/4/2005 10:31:50 AM
I was assuming that you were using a Setup project, but you're talking about
InstallUtil, however my general point might still be useful - make sure
you've not got a 1.1 assembly trying to load a 2.0 one and that you're not
using a 1.1 InstallUtil which might be loading the 1.1 runtime by default
and then trying to use your 2.0 assembly.
--
Phil Wilson
[Microsoft MVP-Windows Installer]

[quoted text, click to view]

Installutil System.BadImageFormatExcepti
12/4/2005 4:34:02 PM
Thank you that was it. I had to fix the systems path to point to the correct
directory for the latest installutil.

[quoted text, click to view]
AddThis Social Bookmark Button