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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With