Nous utilisions WIX 3.5 (numéro de build 1811) et construisions une action personnalisée construite à l'aide de Visual Studio 2008 et avec un framework cible comme .Net 3.5. Cela fonctionnait très bien, jusqu'à ce que nous construisions l'action personnalisée en utilisant Visual Studio 2010 et avec le framework cible comme .Net 4.0.Les actions personnalisées WIX créées pour .Net Framework 4.0 ne fonctionnent pas? Des façons de résoudre?
WIX ne peut pas invoquer l'action personnalisée, l'erreur que nous obtenons est la suivante:
SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSI69BD.tmp-\
SFXCA: Binding to CLR version v2.0.50727
Calling custom action SomeCompany.SomeProduct.InstallerPlugin!SomeCompany.SomeProduct.InstallerPlugin.XYZProductCustomAction.ABCMethod
Error: could not load custom action class SomeCompany.SomeProduct.InstallerPlugin.XYZProductCustomAction from assembly: SomeCompany.SomeProduct.InstallerPlugin
System.BadImageFormatException: Could not load file or assembly 'SomeCompany.SomeProduct.InstallerPlugin' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
File name: 'SomeCompany.SomeProduct.InstallerPlugin'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.AppDomain.Load(String assemblyString)
at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.GetCustomActionMethod(Session session, String assemblyName, String className, String methodName)
Attendez-vous à ce que le 2.0 CLR puisse charger un assembly 4.0 et l'exécuter? –