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

ElektroStudios picture ElektroStudios · Aug 16, 2015 · Viewed 12.1k times · Source

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:

  • Tried procmon from SysInternals but I didn't noticed any strange call.
  • Also I used a Nirsoft app called WhatIsHang which determines any current applications that are hanging in the system then shows some debug info of it, but WhatIsHang does not recognize any hang of devenv.exe, so at least I know that devenv.exe is not hanging, it seems to be just aparently "inactive" doing something strange, and the process never exits by himself.

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.

Answer

Rami A. picture Rami A. · Dec 8, 2015

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.