IIRC:

    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" />
        <supportedRuntime version="v2.0.50727" />
    </startup>

That should work no matter which currently released framework(s) you have
installed (excluding 1.x, of course).

-Blair

-----Original Message-----
From: Christopher Painter [mailto:chr...@deploymentengineering.com] 
Sent: Tuesday, September 28, 2010 3:55 PM
To: g...@gocek.org; General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] BadImageFormatException,
Microsoft.Deployment.WindowsInstaller - RESOLVED!

I haven't really played with DTF and 4.0 much yet.   Is there a solution for

writing a CLR 2.0 Custom Action and then have it work if you have either
.NET 
2-3.5 or .NET 4 installed?


Christopher Painter, Author of Deployment Engineering Blog
Have a hot tip, know a secret or read a really good thread that deserves 
attention? E-Mail Me



----- Original Message ----
From: Gary Gocek <g...@gocek.org>
To: wix-users@lists.sourceforge.net
Sent: Tue, September 28, 2010 5:37:13 PM
Subject: [WiX-users] BadImageFormatException, 
Microsoft.Deployment.WindowsInstaller - RESOLVED!

I previously posted that my .NET 4 project with .NET 4 custom actions had
been failing. This has been resolved, thanks to a co-worker's good catch. I
can now author a totally .NET 4 app from VS 2010 with WIX 3.5.

The MSI log error was:

System.BadImageFormatException: Could not load file or assembly
'CustomAction1' or one of its dependencies. This assembly is built by a
runtime newer than the currently loaded runtime and cannot be loaded.
...
  at
Microsoft.Deployment.WindowsInstaller.CustomActionProxy.GetCustomActionMetho
d(Session session, String assemblyName, String className, String methodName)

The trick is to modify the default CustomAction.config file, included in a
CA project when it is created with Visual Studio. Use these values:

    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" />
    </startup>

In my case, I removed other values for supportedRuntime, but that may not
have been necessary.

Also, in the CA project, for CustomAction.config properties, set 'Copy To
Output Directory' to 'Copy Always'.

Also, you might see "SFXCA: Failed to get requested CLR info. Error code
0x80131700". This is fixed by setting useLegacyV2RuntimeActivationPolicy to
true.

There, now I think I included all the keywords to help someone find this.

Gary



----------------------------------------------------------------------------
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



      

----------------------------------------------------------------------------
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to