Visual Studio 2008 Installer, Custom Action. Breakpoint not firing.
        Posted  
        
            by Snake
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Snake
        
        
        
        Published on 2010-05-31T12:15:08Z
        Indexed on 
            2010/05/31
            13:03 UTC
        
        
        Read the original article
        Hit count: 306
        
visual-studio-2008
|setup-project
Hi,
I've got an installer with a custom action project.
I want the action to fire at install.
The action fires, when I write something to the event log, it works perfectly.
But I really need to debug the file since the action is quite complicated.
So I've got the following installer class:
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()
        {
        }
    }
}
The installer just finalizes without warning me, it doesn't break, it doesn't ask me to attach a debugger.
I've tried debug and release mode. Am I missing something?
Thanks
-Snake
© Stack Overflow or respective owner