My computer has both the vsto project, the framework is .net framework4.8, and the excel-dna project (the framework is net6.0-windows). When I put the CompareDatas-AddIn64-packed.xll file in the xlstart folder of excel When I used visual studio2022 t

313 views
Skip to first unread message

xingzhong zhang

unread,
Oct 10, 2023, 3:08:37 AM10/10/23
to Excel-DNA
     The error that occurs is:A serious error has occurred and debugging needs to be terminated. The debugger is configured to use the desktop CLR (.NET Framework) managed debugger, but the target process is loaded into the CoreCLR (.NET Core) runtime. To debug this project, configure it to use the "Managed (CoreCLR)" debugger.
     When I cleared the xlstart folder, it ran normally.
     The question I want to ask is: How can I use vsto and excel-dna at the same time without running errors?

xingzhong zhang

unread,
Oct 10, 2023, 3:16:52 AM10/10/23
to Excel-DNA
When I run the vsto project with visual studio2022, the above error occurs.

Govert van Drimmelen

unread,
Oct 10, 2023, 3:59:10 AM10/10/23
to exce...@googlegroups.com

The debugger can only run in .NET Framework mode or in .NET 6 mode, not both at the same time.

The message says “debugger is configured to use the desktop CLR (.NET Framework) managed debugger”.

You need to figure out how to change this configuration, so that your debugger uses the other runtime, which matches your project.

 

You do you configure this in Visual Studio?

I don’t really know, but you 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+) debugger
  • 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.

 

-Govert

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/ff479045-4978-4b1c-ab44-71eef9120ffan%40googlegroups.com.

image001.png

xingzhong zhang

unread,
Oct 10, 2023, 8:45:04 PM10/10/23
to Excel-DNA
Thank you !
Now a new problem has arisen: the breakpoint cannot be hit. Tip: The breakpoint will not be hit currently and no symbols have been loaded for the document.

Reply all
Reply to author
Forward
0 new messages