【发布时间】:2014-08-20 13:12:09
【问题描述】:
我有一个安装程序类设置,它使用以下方法作为我的自定义操作运行:
public Installer1()
{
InitializeComponent();
#if DEBUG
Debugger.Launch(); //enables debugging
#endif
}
protected override void OnBeforeInstall(IDictionary savedState)
{
base.OnBeforeInstall(savedState);
ModifyConfig();
}
public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
if (targetSite == null) throw new InstallException("IIS site name not specified");
else
{
//CreateApplicationPool();
//CreateWebsite();
//AssignAppPool();
}
}
我已经注释掉了安装方法中发生的大部分内容,因为此时我只是尝试测试 ModifyConfig()。当我运行安装程序时,调试器按预期启动。但是,当我逐行浏览代码时,完全跳过 OnBeforeInstall 方法并直接跳转到 Install 方法。继续执行它永远不会触发 OnBeforeInstall。
这个方法是在Intall之后添加的,但是我以为会在自动安装之前打到这个。我错过了什么?
【问题讨论】:
标签: c# installation custom-action web-project