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.)
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.
You can use a shortcut ctrl+break in VS, this should cancel build process.
I see this error in Visual Studio 2013 Professional as well. I terminated devenv.exe through Task Manager.
For Visual Studio 2015 or greater, in Menubar, under Build option, there is "cancel" option. This will stop the build.
S O L V E D it!
Had this problem in VS2017 prof vs15.9.16. When performing a build, build starts to compile but never finishes. Build-menu items are grayed out except for 'cancel'. And cancel does not work. Using a different compiler worked! 'Kill process' was the only way to kill the build.
Stripping the program to its bare minimum showed the real problem. There where referenced DLL's that hung the build. Compiling the DLL's and re-referencing them solved the problem.
sometime this problem also arise in VS2015. Following the same process (kill process) would work here too.
I had this problem arise in VS2015. You can specifically kill the MSBuild.exe process without shutting down Visual Studio.
I had this today whilst using VS2019 (16.4.2). I my case I started a publish - it was a database project - and changed my mind so cancelled the publish using Ctrl+Break. The build showed as completed successfully, and the publish did not start. Publish was greyed out and I could not exit VS because of this error. I had no msbuild or vbc processes running. My solution was to kill the devenv process.
Still happens in VS 2022. .Net host process gets stuck while building project with version conflict dependencies. Resolving those conflicts helps and build proceeds, but again, the question why dotnet process is getting stuck on it.
Success story sharing
vbc
please report it to connect.microsoft.com whatever version you're using; though make sure you have all your Windows Updates up to date.Ctrl+Break
or Go to Visual Studio 2013 Build Menu -> cancel build , that easy. reference Hope helps someone.