Vb.net – Visual Studio stuck at “build must be stopped before the solution can be closed”


When the Visual Basic compiler (Vbc.exe) crashes, Visual Studio fails to detect this and becomes stuck in an inoperable state. The "Build" menu appears as it would if the solution were building, but the Cancel Build (Ctrl+Break) menu item has no effect. Trying to close the application or the solution gives the error:

The build must be stopped before the solution can be closed.

I can't find any way to remedy this short of terminating the devenv.exe process and restarting Visual Studio completely. Is there anything quicker and less severe?

(Microsoft claims to have fixed this bug in 2005, but I'm experiencing it with VS2008.)

Best Solution

I'd look for msbuild process(es) to kill before devenv. And make sure vbc really has gone too.

And as the comments say, try using msbuild yourself.

Seeing as I've got a Nice Answer badge from this, I feel I should emphasise my comment below: In all the cases where this has happened to me there have been no msbuild or vbc processes to kill. If anyone gave or gives me a +1 because they did find a stuck msbuild or vbc process, please comment that this was the case too.