【发布时间】:2014-06-04 15:19:07
【问题描述】:
我正在尝试调试我在 c# (VS) 中创建的安装项目...我将项目当前设置为“调试”而不是“发布”,并且我已将以下代码添加到我的自定义操作区域。 ..
public override void Install(System.Collections.IDictionary stateSaver)
{
if (Debugger.IsAttached == false) Debugger.Launch();
MessageBox.Show("Installing Application...");
//Continue with install process
base.Install(stateSaver);
}
//Code to perform at the time of uninstalling application
public override void Uninstall(System.Collections.IDictionary savedState)
{
if (Debugger.IsAttached == false) Debugger.Launch();
MessageBox.Show("Uninstalling Application...");
//Continue with uninstall process
base.Uninstall(savedState);
}
当我去安装时(右键单击设置项目-> 安装)它按预期工作,我可以使用 F11 逐步完成每一行。当我去卸载(右键单击设置项目->卸载)时,它不会让我使用 F11 或继续使用 F5 或查看任何智能感知弹出窗口(如变量值等)。虽然我可以单击文件菜单选项来执行每个操作(调试->继续和调试->单步执行)。
任何想法为什么会出现这种情况以及我如何能够获得该功能?
其他问题:是否可以像使用普通程序一样在运行时单步执行安装项目时更改任何代码(例如添加消息框)?
【问题讨论】:
标签: c# visual-studio-2010 installation custom-action