Re: Unexpected restart when closing Office 2016 using an adx addin at debug time

Add-in Express™ Support Service
That's what is more important than anything else

Re: Unexpected restart when closing Office 2016 using an adx addin at debug time
A workaround I found 
Steven Kendrick


Guest


I just wanted to share a workaround to the problem described in the following thread which is locked:
https://www.add-in-express.com/forum/read.php?FID=5&TID=13509

The workaround is described in this StackOverflow post on how to detach the debugger:
http://stackoverflow.com/questions/7480518/programmatically-detach-debugger/31227508#31227508

What I did was use the following code per the post but I replaced the DetachAll() with TerminateAll():

object dt = Marshal.GetActiveObject("VisualStudio.DTE.12.0")
DTE dte = (DTE)dt;
dte.Debugger.DetachAll();

I replaced the last line with:
dte.Debugger.TerminateAll();

I hope this saves some frustration for people debugging in Office 2016!

Regards,
Steven Kendrick
Posted 02 Sep, 2016 06:46:56 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Oh, Steven, thanks a LOT!


Andrei Smolin
Add-in Express Team Leader
Posted 02 Sep, 2016 07:09:16 Top
Xavier N


Guest


Steven, Andrei,
The problem seems solved with the last version of VS 2015 (Update 3) - at least with VS 2015 Pro. I installed this version last week and tried to debug my addin in Excel 2016 a few times (at least 10 to 20 tests). And the problem was not raised anymore..
I've tried to modify the original post but it seems locked...
Thanks again Andrei for you post on MSDN forum, it seems MS/VS Team resolved the issue...
Regards, Xavier
Posted 03 Sep, 2016 04:55:32 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
You are welcome, Xavier!


Andrei Smolin
Add-in Express Team Leader
Posted 05 Sep, 2016 06:48:47 Top
Steven Kendrick


Guest


Xavier,
Thanks for letting us know. Yes I can confirm, too, that Update 3 fixes the problem so no workaround is needed.
Steven Kendrick
Posted 13 Sep, 2016 05:09:33 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Thank you Steven!


Andrei Smolin
Add-in Express Team Leader
Posted 13 Sep, 2016 07:22:28 Top