Search code examples
excelvb.netvstoaddin-express

Breakpoints not triggering in VSTO Add-in


I was made aware of an interesting situation by my client today. I am sure it is something simple but seems like I can't put my finger on it. Have never faced this issue and Google has not been too helpful.

Problem

On my client's laptop, the Add-In is created with Add-in Express™ for Microsoft® Office and .net. When running the Add-in from VS, the breakpoints do not trigger. I logged in via teamviewer. We created a new test project (Add-in) and added this simple code.

Private Sub AdxExcelAppEvents1_WorkbookOpen(sender As Object, hostObj As Object) Handles _
AdxExcelAppEvents1.WorkbookOpen
    MessageBox.Show ("Hello World")
End Sub

I put a breakpoint on AdxExcelAppEvents1_WorkbookOpen and ran. I got the message when I opened a new workbook but the breakpoint did not trigger.

I tested the same code on my laptop and it works just fine.

What has he and I tried

  1. Unregister, Clean + Rebuild, Register
  2. Manually cleaning the Debug folder
  3. Repairing Add-In Express
  4. Uninstalling/ReInstalling Add-In Express
  5. Jumping between frameworks 4.5 and 4.6, 4.7.1
  6. Toggling Tools | Options | Debugging | General require source files to exactly match the original version
  7. Toggling Solution platforms (x86|64|AnyCPU)

Applications

  1. Visual Studio Version: 2019 Pro
  2. MS Office: 2016 Professional Plu 2016

Let me know if you need anything else?

FYI: This has been crossposted at Add-in Express forum I usually do not crosspost but seems like my client is under pressure and has to deliver this project on monday morning.


Solution

  • You can use the method Debugger.Break from System.Diagnostics and observe if you get more information about a plausible unhandled exception. In this case, we get the exception wkernelbase.pdb not loaded and Siddharth found it can be fixed by selecting : Tools->Options->Debugging->Symbols->Select "Microsoft Symbol Servers".