- a C# console application project called “cwebber”.
- a C# class library project called “Webber”.
- a setup project called “Webber Setup”.
Webber Setup will install cwebber and create its Start Menu shortcut and register Webber as a OneNote add-in. To debug Webber:
- Build Webber Setup and run the .msi to setup the add in
- At the beginning of the OnClick event of the add-in (found in Program.cs), put a MessageBox in order to suspend the process when the event has fired, given us enough time to attach the debugger.
- In OneNote, click on the add-in icon. The message box will be displayed.
- With the MessageBox displayed, go to visual studio, open the Webber solution, choose Debug->Attach to Process and select dllhost.exe (aka COM surrogate), which is the process responsible for handling the add-in’s DLL
- Breakpoints will now be hit.
Tip: After you’ve installed the .msi for the OneNote add-in, on some subsequent changes to the code, you don’t have to uninstall and re-install the msi. Just quit OneNote, ensure that the project properties for webber have been set to “Register for COM interop”, build it, and the changes will be reflected.