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

15,494

Solution 1

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.

Solution 2

Go to task manager, then Background processes. There close the visual studio. It worked for me.

Solution 3

I also encountered this issue, and I just managed to get it solved purely by chance. I was using Resharper 9, and I just upgraded to Resharper 10. This solved it for me.

EDIT: It appears my joy was premature; After opening a more complex solution, VS2015 again refuses to exit after closing...

Share:
15,494
ElektroStudios
Author by

ElektroStudios

Updated on June 15, 2022

Comments

  • ElektroStudios
    ElektroStudios about 2 years

    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.

  • ElektroStudios
    ElektroStudios over 8 years
    Thanks for answer. Try follow setting the property mentioned on the accepted answer, it worked for me in VS2015. Anyways I don't understand in which way how you managed to get it solved just by installing a refactor plugin/extension because the issue is not involved in any way with that plugin :P
  • Aviad P.
    Aviad P. over 8 years
    It could be that Resharper uses an automation call that keeps devenv.exe alive... and Resharper 10 is smarter and releases the resource properly...
  • shay__
    shay__ almost 8 years
    +1 for complex solution - I encounter this issue only on a specific complex solution (100+ projects, don't ask)
  • Bogdan
    Bogdan almost 7 years
    Can this setting be set by using some kind of command line switch?
  • Rami A.
    Rami A. almost 7 years
    @Bogdan, the documentation for the devenv.exe command line switches can be found here: msdn.microsoft.com/en-us/library/xee0c8y7.aspx. Depending on your requirements, the /Runexit command line switch may be what you want, but I don't know enough about your requirements. You should probably ask a new question.