2010-05-31 49 views
1

我有一个自定义操作项目的安装程序。Visual Studio 2008安装程序,自定义操作。断点没有触发

我想要在安装时触发该操作。

当我向事件日志写入内容时,动作会触发,它可以很好地工作。

但我真的需要调试该文件,因为该操作相当复杂。

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

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

     } 
    } 
} 

安装程序只是最终确定没有警告我,它不会破坏,它不问我附加一个调试器。

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

感谢

-Snake

回答

1

的解决方案是火base.Install去年。很明显,base.Install之后的代码不会被执行。

相关问题