I have found there are a couple of situations that cause Visual Studio (2017 15.8.8) to hang up background processes such as VBCSCompilier
and a conhost.exe
. These are absolutely caused by errors I make, mostly anytime you have an error that deals with resources or locations (pages, js files etc) and it is not there, this will cause Visual Studio to hang up and not allow IIS to update when you restart VS because the background processes are still being used.
I have spent hours trying to figure out why my website is not updating and when I look at my Task Manager sure enough those processes are still running when VS is shutdown, kill those processes and everything works.
Is there a way possibly using PowerShell to look for running processes and kill them if they are still running? I do not have enough experience with PowerShell scripting to feel comfortable enough to try and mess with running processes and not sure if there is a better way to handle this or if there are other processes that should be restarted or possibly even something from Microsoft that already does this?
So far I have identified the following that need to be killed before restarting Visual Studio:
VBCSCompiler.exe
conhost.exe <-- Only ones running under username not the MYSQL user