我尝试向安装程序项目添加自定义操作。我添加了一个自定义操作项目,其中包含以下代码:
public class CustomActions
{
[CustomAction]
public static ActionResult CustomAction1(Session session)
{
session.Log("Begin CustomAction1");
return ActionResult.Success;
}
}
在我的安装程序项目中,我添加了对CustomAction_project的引用,并在以下条目中添加了自定义操作 - >安装:
名称:CustomAction的主要输出(活动) EntryPoint:CustomAction1 InstallerClass:错误 SourcePath:CustomAction.dll的路径
现在,如果我尝试构建我的安装程序项目,我会收到以下错误:
错误:切入点' CustomAction1'在模块中找不到 ' PATH \ CustomAction.dll'用于自定义操作'主要输出来自 CustomAction(活动)'。
我错了什么?自定义操作代码由Visual Studio 2013自动生成!
答案 0 :(得分:1)
您已构建了一个用于WiX设置的托管代码自定义操作项目。如果您使用的是本机Visual Studio安装程序项目,则需要安装程序类自定义操作。这些可能会有所帮助:
https://msdn.microsoft.com/en-us/library/vstudio/d9k65z2d(v=vs.100).aspx
http://vbcity.com/forums/t/145818.aspx
基本上,您将一个安装程序类添加到项目中,并覆盖install方法。
答案 1 :(得分:0)