Reputation: 149325
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
Tools | Options | Debugging | General require source files to exactly match the original version
Applications
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.
Upvotes: 3
Views: 356
Reputation: 459
I suppose there's an {excel}.exe.config file in the Office folder. The .config requires all add-ins to use .NET 2.0 (3.0, 3.5).
That would explain the issue: you use .NET 2.0 (3.0, 3.5) while the debugger expects to use .NET 4.0 (4.X).
And yes, Add-in Express is built around the COM Add-in technology, not VSTO Add-in.
Upvotes: 0
Reputation: 6732
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"
.
Upvotes: 2