WIxsharp debug custom action in console(WIxsharp 在控制台中调试自定义操作)
问题描述
我有一个编译为 .dll 的自定义操作项目,我希望能够逐步执行我的自定义操作,我知道可以将包更改为 wixsharp.bin 但这并不实用.无论如何,我仍然尝试了这种方法,但它没有达到我的断点.
I have a custom action project which compiles to a .dll, I want to be able to step through my custom actions, i know the package can be changed to wixsharp.bin but this dosn't seen very practical. Regardless, I still tried this method but it didn't hit my breakpoints.
Wix 使用:System.Diagnostics.Debugger.Launch();
在调试中启动操作,这似乎不适用于 wixsharp,但它的预期结果是我想要实现的.
Wix uses: System.Diagnostics.Debugger.Launch();
which launches the action in debug, this dosn't seem to work for wixsharp but it's expected result is what i am trying to achieve.
我已经看到 debug.assert 可以用于调试,并且我还看到了对 #if DEBUG #endif
的引用我如何正确调试?
I have seen that debug.assert can be used for debugging and i have also seen references to #if DEBUG #endif
How do i debug correctly?
[CustomAction]
public static ActionResult CustomAction(Session session)
{
Debug.Assert();
MessageBox.Show("Hello World!" + session[IISSessions.AppPoolName], "External Managed CA");
return ActionResult.Success;
}
推荐答案
不太清楚是什么导致了问题,我删除了我的 bin 文件夹,然后运行了构建,现在它似乎可以工作了.System.Diagnostics.Debugger.Launch()
确实可以正常工作,它需要包含在 #if DEBUG
中,正如@Stein Åsmul 所述.一旦内置 DEBUG 运行输出的 .msi,当您在安装过程中点击自定义操作时,系统会提示您打开 Visual Studio 的实例.
Not quite sure what was causing the problem, I deleted my bin folder and then ran a build and it now seems to be working. System.Diagnostics.Debugger.Launch()
does work correctly it needs to be contained within an #if DEBUG
as @Stein Åsmul stated. Once built in DEBUG run the outputed .msi, you will be prompted to open an instance of visual studio when you hit your custom action during install.
[CustomAction]
public static ActionResult CustomAction(Session session)
{
#if DEBUG
System.Diagnostics.Debugger.Launch();
#endif
MessageBox.Show("Hello World!" + session[IISSessions.AppPoolName], "External Managed CA");
return ActionResult.Success;
}
这篇关于WIxsharp 在控制台中调试自定义操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:WIxsharp 在控制台中调试自定义操作


基础教程推荐
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01