Visual Studio – “Build must be stopped before the solution can be closed” error

Time and again I have been getting this nasty error for no obvious reason as seen below –

BuildMustBeStopped

The first step I tried is to stop the build by going to – Build-> ‘Cancel Build’. That just doesn’t work. So here are the scripts I run to close my session –

$p = get-process devenv
Stop-Process $p -WhatIf
Stop-Process $p

I first get the process id in the variable. Check to see if what I need to close is what I intend and then proceed to stop it. That’s all there is to do. You now need to open a new instance of Visual Studio and get cracking on whatever it is that you are working on.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s