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.
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.