How to debug and step through an installer custom action
After playing around with google to find a Visual Studio.Net way of attaching to a Setup and Deployment Project (msi) for debugging, I switched tacts. I found that I was really not trying to debug the msi but instead I was trying to debug teh custom actions.
Usnig this in the search engine I found out you simply need to put the following line at the point in your code that you would like to begin debugging:
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.
Thanks to Jon Robinson
Usnig this in the search engine I found out 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.
Thanks to Jon Robinson
0 Comments:
Post a Comment
<< Home