Josh Robinson's WebLog

How to debug and step through installer classes

I have finally figured out how to debug installer classes that are called by a custom action from a .NET deployment project.  You simply need to put the following line at the point in your code that you would like to begin debugging:

System.Diagnostics.Debugger.Break();

Run the installer and once it hits that line (I put mine in the overridden Install() method), it will ask you if you would like to open a new debugger.  Select Visual Studio, select the option to debug the Common Language Runtime (I deselected Native), hit Ok and now you will be able to step through your installer code, view local variables, etc.  Very easy and very useful when attempting to debug installer code.

Comments

Jacques Du Preez said:

ThanX a million for the Gr8 tip!
# January 14, 2005 10:43 AM

Josh Robinson said:

I think that this same result can be accomplished by attaching the debugger to the installer process while it is executing, much like debugging a service. I haven't tried that method, but if anyone has I would be interested to hear your results.

-Josh
# January 14, 2005 11:07 AM

TrackBack said:

# February 11, 2005 3:21 PM

TrackBack said:

# February 11, 2005 3:32 PM

TrackBack said:

# March 2, 2005 12:58 PM

TrackBack said:

# March 2, 2005 12:58 PM

TrackBack said:

# March 2, 2005 12:58 PM

TrackBack said:

debug and step through custom installer classes
# March 10, 2005 11:51 AM

TrackBack said:

Chroniques d'Améthyste - Les déboggages difficiles
# March 19, 2005 2:10 AM

Abhishek said:

It really helped me a lot,

Thanks a Lot

# January 24, 2009 7:55 AM

Prakash said:

I am doing the same thing. But when debugger opens, it gives error message "Unable to attache the crashing process. Access denied"

I can't figure out, what is the problem. I had already logged with administrator user.

Any idea?

# July 29, 2009 3:44 PM

Jason Kouyoumdjian said:

I created a debug version of my setup, using a DLL with the Installer class.

I then tried attaching the 2008 debugger to the instance of the installer that is running, the breakpoint was not hit....

The System.Diagnostics.Debugger.Break(); method works though.

# September 30, 2009 11:11 AM

Gaurav said:

Cool ! Helped me a lot

# February 11, 2010 1:05 AM

Kike said:

Thanks!! a great post.

# September 8, 2010 10:19 AM

sudz said:

very useful.. thanks

# November 15, 2010 8:30 AM

John Zhang said:

Thanks ...that helps a lot!

# December 26, 2010 7:52 PM

DLeo said:

Thanks man! Great tip :)

# March 24, 2011 6:57 AM

Rohit Verma said:

Its gr8.. helped me a lot. Thanks

# May 28, 2011 12:38 AM

Jens said:

I'm running Vs2010 Framwork 4.0

If you can't get the Debugger.Break() to work try the Debugger.Launch() instead.

# June 22, 2011 7:18 AM

Debugging a custom Installer class | Ashlesh Patel's Blog said:

Pingback from  Debugging a custom Installer class | Ashlesh Patel's Blog

# December 2, 2011 12:41 AM

Johannes said:

No, that doesn't work. I have added the Custom Action and the Installer class but it is never called (on 64bit Windows)

# December 21, 2011 9:58 AM

icon set said:

# October 7, 2012 10:00 AM

icons set said:

<a href="www.softwaredownloads.org/.../screenshot-job-icon-set.html"> I think, that you are not right. I am assured. I can defend the position. Write to me in PM, we will communicate.</a>

# October 8, 2012 5:29 PM

icon pack said:

<a href="www.mobiledone.com/index.php In my opinion you are mistaken. I suggest it to discuss.</a>

# October 9, 2012 1:38 AM

north face jackets cheap said:

Have you ever considered about adding a little bit more than just your articles? I mean, what you say is important and all. But think about if you added some great graphics or videos to give your posts more, "pop"! Your content is excellent but with images and clips, this site could undeniably be one of the most beneficial in its niche. Amazing blog!

# December 7, 2012 4:53 AM

Shipp said:

you're in reality a good webmaster. The site loading speed is incredible. It kind of feels that you're doing any distinctive trick.

In addition, The contents are masterwork. you have performed a fantastic task on this subject!

# March 25, 2013 7:24 PM

http://stronaprawastronalewa.com said:

Yay google is my king helped me to find this superb internet site !

# March 26, 2013 8:16 PM

Chism said:

We're a gaggle of volunteers and opening a brand new scheme in our community. Your website offered us with helpful information to work on. You have performed an impressive process and our whole neighborhood will probably be grateful to you.

# April 5, 2013 2:36 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)