c# - Wixsharp 如何引用自定义动作项目
问题描述
我的解决方案中目前有两个项目,一个构建 msi 的部署项目和另一个包含我的自定义操作的项目。我无法引用我的自定义操作,同样的两个错误不断出现:
..\WixSharp Setup\bin\Debug\WixSharpSetup.exe" "/MSBUILD:WixSharp Setup" "/WIXBIN:"" exited with code -532462766. WixSharp Setup ..\WixSharp Setup\packages\WixSharp.1.9.2\build\WixSharp.targets 6
No CA or UI entry points found in module: ..\WixSharp Setup\WixSharp Setup\WixSharpSetup.exe WixSharp Setup ..\WixSharp Setup\WixSharp Setup\EXEC
部署项目
using System;
using System.Windows.Forms;
using Deploy.CustomAction;
using WixSharp;
using WixSharp.Forms;
namespace WixSharp_Setup
{
class Program
{
static void Main()
{
var project = new ManagedProject("MyProduct",
new Dir(@"%ProgramFiles%\My Company\My Product",
new File("Program.cs")),
new ManagedAction(SearchAPIActions.SearchAPIInstall));
project.GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889b");
project.ManagedUI = ManagedUI.Default; //all standard UI dialogs
project.BuildMsi();
}
自定义动作项目
public class SearchAPIActions
{
[CustomAction]
public static ActionResult SearchAPIInstall(Session session)
{
session.Log("Begin CustomAction1");
return ActionResult.Success;
}
解决方案
万一有人感兴趣,我找到了我的问题的解决方案,因为自定义操作正在编译为 .dll,因此您需要在声明 managedAction 时直接引用它。
new ManagedAction(CustomActions.IISReset, @"Your full Path\Customs.dll"));
推荐阅读
- java - Spring JPA 无法从类型 [java.lang.String] 转换为类型 [java.lang.Long] 的值“为什么?”
- bash - bash 脚本 subshesll 中的变量
- angular - 如何在stackblitz中添加chartjs插件漏斗、插件?
- python - tf.records 的替代品?在 tensorflow 中训练 CNN
- angular - 如何使用 angulafire2 正确初始化和分配 observable?
- vmware-clarity - 如何检测垂直导航组何时展开/折叠
- c - 为什么C在中定义M_2_SQRTPI常量
? - c# - C#使用一种方法检查数字是否为素数,不是素数或负数
- python - Python:COLLECTION 库的双端队列在处理大容量时需要时间和内存
- android - 如何在 Mac 上安装最新的 Android SDK 工具