我正在尝试使用session.Log("Hello World!")从我的C#Custom Action登录; 执行我的msi时,这不会显示在我的日志文件中,如下所示:
msiexec/i myMsi.msi/lvx myLog.log
我的自定义操作正常,我唯一的问题是我没有得到我的日志信息.日志显示我的CA被调用,而不是来自我的session.Log()调用的信息.
我正在使用Wix 3.5,.Net 4,VS 2010和64位Windows 7.我调用我的操作如下.
<Control Id="TestConnection" Type="PushButton" X="21" Y="177" Width="100" Height="17" Text="Test Connection">
<Publish Event="DoAction" Value="TestConnection">1</Publish>
</Control>
Run Code Online (Sandbox Code Playgroud) 我想在WiX中使用我的第一个自定义操作,我得到:
错误2896:执行操作CustomActionTest失败.
我使用的是Visual Studio 2010,WiX 3.5,64位Windows 7旗舰版,.NET Framework 4.
以下是我认为的相关部分:
<Binary Id="JudgeEditionCA" SourceFile="..\JudgeEditionCA\bin\Debug\JudgeEdition.CA.dll" />
<CustomAction Id="CustomActionTest" BinaryKey="JudgeEditionCA" DllEntry="CustomActionOne" Execute="immediate"/>
<Control Id="Next" Type="PushButton" X="248" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" >
<Publish Event="DoAction" Value="CustomActionTest">1</Publish>
<Publish Event="DoAction" Value="InvalidClientDesc">CLIENT_DESC_VALID = "0"</Publish>
<Publish Event="NewDialog" Value="VerifyReadyDlg">CLIENT_DESC_VALID = "1"</Publish>
</Control>
Run Code Online (Sandbox Code Playgroud)
从行动:
namespace JudgeEditionCA
{
public class CustomActions
{
[CustomAction]
public static ActionResult CustomActionOne( Session session )
{
return ActionResult.Success;
}
}
}
Run Code Online (Sandbox Code Playgroud)
以及自定义操作的配置文件:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="false">
<supportedRuntime version="v4.0" />
</startup>
</configuration>
Run Code Online (Sandbox Code Playgroud)
最后,我在我的WiX项目中使用了项目引用来自定义操作.我不确定我做错了什么.