【问题标题】:Visual Studio 2008 Installer, Custom Action. Breakpoint not firingVisual Studio 2008 安装程序,自定义操作。断点未触发
【发布时间】:2010-05-31 20:57:35
【问题描述】:

我有一个带有自定义操作项目的安装程序。

我希望在安装时触发该操作。

动作触发,当我在事件日志中写入内容时,它可以完美运行。

但我确实需要调试文件,因为操作非常复杂。

所以我有以下安装程序类:

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()
        {

        }
    }
}

安装程序只是在没有警告我的情况下完成,它没有中断,也没有要求我附加调试器。

我尝试过调试和发布模式。我错过了什么吗?

谢谢

-蛇

【问题讨论】:

    标签: visual-studio-2008 setup-project


    【解决方案1】:

    解决方案是最后触发base.Install。显然base.Install之后的代码没有被执行。

    【讨论】:

      猜你喜欢
      • 2023-03-29
      • 1970-01-01
      • 2015-09-05
      • 1970-01-01
      • 2013-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多