我正在尝试使用WIX 3.7 UI创建应用程序。如果我汇编我的代码使用的地方。编译.NET 4.0时,我收到以下错误消息:
SFXCA:绑定到CLR版本v2.0.50727
错误:无法从程序集加载嵌入式UI类EmbeddedUI.EmbeddedUI:CustomActions
我在CustomAction.config中尝试过不同的东西。目前的版本是:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
</configuration>
该课程实施如下:
public class HelloWorld : IEmbeddedUI
{
#region IEmbeddedUI Members
public bool Initialize(Session session, string resourcePath, ref InstallUIOptions internalUILevel)
{
System.Windows.Forms.MessageBox.Show("test256");
return true;
}
public MessageResult ProcessMessage(InstallMessage messageType, Record messageRecord, MessageButtons buttons, MessageIcon icon, MessageDefaultButton defaultButton)
{
return MessageResult.OK;
}
public void Shutdown()
{
}
#endregion
}
在Product.wxs文件中:
<UI Id="Embedded">
<EmbeddedUI Id="MyTest" Name="CustomAction45CA.dll" SourceFile="..\CustomAction45\bin\Debug\CustomAction45CA.dll">
</EmbeddedUI>
</UI>
我正在使用Visual Studio 2012.
当我从AssemblyProperties中的Framework从4.0切换到3.5时,一切正常。
使用bootstrapper应用程序的测试适用于框架4.0
我怀疑MakeSfxCA.exe让我的dll坏了。但我不知道我能做些什么。我已经尝试过MakeSfxCA.exe.config和x86和x64。
我将非常感谢任何帮助
答案 0 :(得分:0)
只有EmbedddedUI才会抛出错误。来自同一dll的CustomAction与安装程序日志中的消息一起运行SFXCA:绑定到CLR版本v4.0.30319