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

Reply via email to