在将使用SlimDX并因此具有非托管代码的项目转换为.NET 4.0时,我遇到了以下错误:
混合模式程序集是针对运行时的版本"v2.0.50727"构建的,如果没有其他配置信息,则无法在4.0运行时加载.
谷歌搜索给了我解决方案,这是将其添加到应用程序配置:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我的问题是,做了useLegacyV2RuntimeActivationPolicy
什么?我找不到任何关于它的文档.
我正在尝试为我的Wix安装创建一个自定义操作,它只是不起作用,我不确定为什么.
这是适当的Wix文件中的位:
<Binary Id="INSTALLERHELPER" SourceFile=".\Lib\InstallerHelper.dll" />
<CustomAction Id="HelperAction" BinaryKey="INSTALLERHELPER" DllEntry="CustomAction1" Execute="immediate" />
Run Code Online (Sandbox Code Playgroud)
这是我的自定义操作的完整类文件:
using Microsoft.Deployment.WindowsInstaller;
namespace InstallerHelper
{
public class CustomActions
{
[CustomAction]
public static ActionResult CustomAction1(Session session)
{
session.Log("Begin CustomAction1");
return ActionResult.Success;
}
}
}
Run Code Online (Sandbox Code Playgroud)
该操作由UI中的按钮按下(现在):
<Control Id="Next" Type="PushButton" X="248" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" >
<Publish Event="DoAction" Value="HelperAction">1</Publish>
</Control>
Run Code Online (Sandbox Code Playgroud)
当我运行MSI时,我在日志中收到此错误:
MSI (c) (08:5C) [10:08:36:978]: Connected to service for CA interface.
MSI (c) (08:4C) [10:08:37:030]: Note: 1: 1723 2: SQLHelperAction 3: CustomAction1 4: C:\Users\NATHAN~1.TYL\AppData\Local\Temp\MSI684F.tmp
Error 1723. There is a …
Run Code Online (Sandbox Code Playgroud)