The problem about the breakpoint in VS

40 views
Skip to first unread message

Spike

unread,
Oct 16, 2023, 3:50:34 AM10/16/23
to Excel-DNA
Hello,

I am rookie of ExcelDna, and I just met the issue. After I set the breakpoint and started to debug the code, the program wouldn't stop at the breakpoint if I called this function in Excel. And these breakpoints in the IDE show that the breakpoints are disable.

Govert van Drimmelen

unread,
Oct 16, 2023, 4:38:16 AM10/16/23
to Excel-DNA

Can try this procedure:

  • Have Visual Studio open with your project loaded.
  • Start Excel from outside te debugger.
  • Select Debug -> Attach to Process
  • Click on the Excel process in the list, then click on Code Type, and select the Managed (.NET Core, .NET 5+), or Managed (.NET 4.x)  debugger depending on your project
  • Then click Attach.
  • Then you can load your add in and debug.

 

Next time you run your project with the debugger (normal F5 debugging), it should still remember this setting, and debug with the right debugger.

I think Visual Studio somehow remembers what debugging engine was used last time against a particular executable. If the debugger starts with the wrong debugger it won't work. By default (before the add-in is loaded) Visual Studio detects only the native code, or maybe it detects the wrong type of .NET runtime.

Let us know if this works for you.

-Govert

Spike

unread,
Oct 16, 2023, 6:19:33 AM10/16/23
to Excel-DNA
Hello Govert,

I am so excited that you can reply to me, however, this solution does not work for my problem.


Best regards, 
Spike
Reply all
Reply to author
Forward
0 new messages