Installutil System.BadImageFormatException

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
known issues with this or s there a work around for this?
 
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
(e-mail address removed)> wrote in message
news:[email protected]...
 
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]

Phil Wilson said:
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
(e-mail address removed)> wrote in message
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
known issues with this or s there a work around for this?
 
Thank you that was it. I had to fix the systems path to point to the correct
directory for the latest installutil.

Phil Wilson said:
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]

Phil Wilson said:
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
(e-mail address removed)> wrote in message
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
known issues with this or s there a work around for this?
 
Back
Top