New Zealand's new Copyright Law presumes 'Guilt Upon Accusation' and will Cut Off Internet Connections without a trial. CreativeFreedom.org.nz is against this unjust law - help us


A Space for All Things .NET Related


System.BadImageFormatException

By James Hippolite, in , posted: 17-Jan-2013 12:02

Scenario:

  • I've built a .NET 4.0 Windows Forms app...
  • I've added it to a .NET 4.0 Setup project...
  • My DEV PC has .NET 4.0 Framework installed...
  • When I attempt to install the resultant .msi, I get an error message...

System.BadImageFormatException: Could not load file or assembly...This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Setup:

  • On a DEV VM
  • 32 bit
  • Windows 7
  • Visual Studio 2010.

 

Resolution:

  • The Setup project has a folder for Detected Dependencies...
  • In there is listed Microsoft .NET Framework...
  • When you double-click that, you get a Launch Conditions window...
  • Under Launch Conditions, is listed the .NET Framework version...
  • This was set incorrectly.


Other related posts:
Teach Yourself Azure in 4 hours
Geek Post Monthly Newsletter Volume 2 Issue 10
GeekPost Weekly Newsletter Volume 1 Issue 9








Comment by reven, on 17-Jan-2013 13:18

I get this a lot trying to load a 32bit DLL in a 64bit/AnyCpu(on 64 bit machine) binary.
fix for that is set the project to 32bit.


Add a comment

Please note: comments that are inappropriate or promotional in nature will be deleted. E-mail addresses are not displayed, but you must enter a valid e-mail address to confirm your comments.

Are you a registered Geekzone user? Login to have the fields below automatically filled in for you and to enable links in comments. If you have (or qualify to have) a Geekzone Blog then your comment will be automatically confirmed and shown in this blog post.

Your name:

Your e-mail:

Your webpage:

JamesHip's profile

James Hippolite
Wellington
New Zealand


Welcome to my technical blog. 

Here, I attempt to distill the Microsoft Certified Professional Developer knowledge I have accumulated since first qualifying MCP in 1996.  This blog started on 13 September 2007 as an off-shoot from my mixed up personal blog.  But it took a shot in the arm from Scott Hanselman's talk at TechEd New Zealand 08 "32 Ways To Make Your Blog Suck Less".