tags:

views:

215

answers:

2

I have installed the .net 4 framework on one of my servers.

When I run an installation project created in Visual Studio - get the following error:

Error 1001 Exception occurred while initializing the installation. System.BadImageFormatException: Could not load file or assembly or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

I've definately installed the .net 4 framework on the target machine - what's going on?

+4  A: 

I eventually found the solution to this, and blogged about it here: http://bit.ly/bDGKi4

alex
I'm having the same problem. Howver, your link is blocked at work. It is tagged as a malicious site for some reason. Can you point me in the right direction?
Kevin
I was lucky enough to have that pants-cow virus on my site-The above answer is a summary of what to do.
alex
A: 
  1. Click on the installer project, then go to Project>Properties.
  2. Click on the Prerequisites button
  3. Check the “Microsoft .NET Framework 4 (x86 and x64)” box and uncheck the previous version of the framework
  4. Hit ok on the Prerequisites window and on the the properties window.
  5. Right click on the installer project and go to View>Launch Conditions
  6. Highlight the .NET Framework condition and update the following fields in the properties box
    a. InstallURL : http://msdn.microsoft.com/en-us/netframework/aa569263.aspx
    b. Version: .NET Framework 4
  7. Rebuild the installer
Kevin