Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Exception occurred while initializing the installation: System.BadImageFormatException: The format of the file '<myfilename> is invalid..
 

Exception occurred while initializing the installation: System.BadImageFormatException: The format of the file '<myfilename> is invalid..

I was trying to create MMC3.0 SnapIn using C#
Environment : VS 2008 SP1

I could create the SnapIn dll and when I try to install it , I am getting the abobe kind of error

Error in Detail

C:\Gigy\Code\MMC\MyVelocityAdminTool\MyVelocityAdminTool\bin\Debug>installUtil -
i MyVelocityAdminTool.dll
Microsoft (R) .NET Framework Installation utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Exception occurred while initializing the installation:
System.BadImageFormatException: The format of the file 'MyVelocityAdminTool.dll'
is invalid..

GigyJ  Friday, April 03, 2009 8:54 PM

Hi GigyJ,

Have a try running the InstallUtil tool from the Visual Studio 2008 Command Prompt.

Hope this helps.

Linda Liu

  • Marked As Answer byGigyJ Wednesday, August 26, 2009 6:31 PM
  •  
Linda Liu  Friday, April 10, 2009 4:08 AM
Are you mixing framework versions? You'll get that kind of error if a 1.1 assembly tries to load a 2.0 assembly.
Phil Wilson
PhilWilson  Friday, April 03, 2009 9:21 PM

Looks to me it is trying to load 1.1 assembly.

Microsoft (R) .NET Framework Installation utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.


How can I get rid of this ?

Thanks

GigyJ  Monday, April 06, 2009 12:47 PM

Hi GigyJ,

Have a try running the InstallUtil tool from the Visual Studio 2008 Command Prompt.

Hope this helps.

Linda Liu

  • Marked As Answer byGigyJ Wednesday, August 26, 2009 6:31 PM
  •  
Linda Liu  Friday, April 10, 2009 4:08 AM
Exactly what happened to me when I went to VS 2008 which does not know .Net 1.1 this really savedme thanks cuz it could have been anything for all I knew



Aging C# developer
Pat King  Wednesday, September 16, 2009 9:01 PM

You can use google to search for other answers

Custom Search

More Threads

• WPF application publish.
• How to resign a manifest file.
• Unknown Error when Publishing Application
• How to change SourcePath dynamicly
• All Users and Admin Rights
• Program not appearing in Program menu
• Signing an IE Control
• Avoiding users from distributing ClickOnce files
• Can we run Custom exe while ClickOnce deployment.
• Language localization