我有一个带有自定义操作项目的安装程序。
我希望该操作在安装时触发。
当我向事件日志写入内容时,该操作会触发,它运行得很好。
但我确实需要调试该文件,因为操作非常复杂。
所以我有以下安装程序类:
namespace InstallerActions
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Diagnostics;
using System.IO;
[RunInstaller(true)]
// ReSharper disable UnusedMember.Global
public partial class DatabaseInstallerAction : Installer
// ReSharper restore UnusedMember.Global
{
public DatabaseInstallerAction()
{
InitializeComponent();
}
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
System.Diagnostics.Debugger.Launch();
System.Diagnostics.Debugger.Break();
// none of these work
Foo();
}
private static void Foo()
{
}
}
}
安装程序只是在没有警告我的情况下完成,它不会中断,也不会要求我附加调试器。
我尝试过调试和发布模式。我错过了什么吗?
Thanks
-Snake
解决办法就是开火base.Install
和最后一样。显然后面的代码base.Install
没有被执行。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)