Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WIX custom action debugging doesn't work

Tags:

I have tried to debug my custom action. I put Debugger.Break() into custom action cs. When I build custom action it creates this files:

myCustomAction.dll myCustomAction.CA.dll myCustomAction.pdb 

In wix project I reference myCustomAction.CA.dll inside binary tags (not myCustomAction.dll). Since there doesn't exists myCustomAction.CA.pdb is this the reason that debugging doesn't work? I have tried also with messagebox and attach to process, when message box is shown. But i get the following message: Cannot find or open the PDB file.

What I'm doing wrong? I have wix 3.5 version and visual studio 2010.

like image 590
Simon Avatar asked Mar 14 '13 08:03

Simon


People also ask

How do I debug custom action in WiX Installer?

Debugger. Launch(); Then just run the installer. When it starts to execute your action, the popup window will appear with proposal to launch visual studio for debugging.

How do I debug custom action?

From the menu bar select Tools -> Attach to Process option. In the newly opened dialog enable the Show processes from all users checkbox. In the Available Processes list select the process with the ID displayed by the custom action dialog. Click on [ Attach ] button to start debugging.


1 Answers

Here is the article which helped me.

Just add the following code to the first line of your custom action:

System.Diagnostics.Debugger.Launch(); 

Then just run the installer. When it starts to execute your action, the popup window will appear with proposal to launch visual studio for debugging.

Your reference library is correct, it must be *.CA.dll. Also the approach with MessageBox would work too, but you will need to attach to the rundll32 process.

like image 117
vortexwolf Avatar answered Sep 19 '22 18:09

vortexwolf