.netvisual-studiovisual-studio-2015envdtedevenv

devenv process keeps running in background after I close Visual Studio 2015


Problem


When I close Visual Studio 2015 by pressing the close button on the IDE, the devenv.exe process keeps running in background between 3-5 minutes, after that time, it closes automatically, really strange.

I discovered this issue because I was trying to install an extension automatedly using DTE (in the same way as I did for Visual Studio 2013 in the past without any problem), but when I call the method dte.Quit() it does not makes Visual Studio 2015 to close, the devenv.exe will keeps in background forever (until a manual process kill).

Question


Someone could have an idea why I'm suffering this issue?.

Someone has the same issue?, someone found a way to fix it?.

It is an official bug?, is there an update or patch?.

Or maybe in the worst case following new Microsoft "philosophy" it could be one of their spy mechanisms that keeps running even when the end-user tried to close the IDE?.

Research


I have poor knowledges for problem resolutions like this like debugging a 3rd party app or reverse engineering knowledges but I did some basic things:

Environment Specifications


Windows Version:

Windows Spy 10, aka Windows 10 Professional (v10.0.10240) of 64-Bit, running on VMWare WorkStation.

Visual Studio Version:

2015 Professional (v14.0.23107.0)

3rd Party IDE extensions or any other sort of modification Installed?:

No, it's a fresh install of the product.


Solution

  • To have devenv.exe automatically close when launched using automation, call dte.UserControl = false;

    http://www.mztools.com/articles/2005/mz2005005.aspx

    DTE.UserControl: when set to True, the IDE remains open after you are done with the automation. This is useful if you want to open the IDE, perform some action, and keep it open for the user to continue using it. When set to False, the object is released after you are done with the automation and the devenv.exe process shouldn't remain in memory (use the Task Manager to verify it). If it stays in memory, it means that you are not releasing all COM wrappers used to automate it.