vb.net Visual Studio 卡在“必须停止构建才能关闭解决方案”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6074968/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 15:30:45  来源:igfitidea点击:

Visual Studio stuck at "build must be stopped before the solution can be closed"

vb.netvisual-studio

提问by duozmo

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:

当 Visual Basic 编译器 (Vbc.exe) 崩溃时,Visual Studio 无法检测到这种情况并陷入无法操作的状态。“构建”菜单的显示方式与正在构建解决方案时一样,但“取消构建”(Ctrl+Break) 菜单项无效。尝试关闭应用程序或解决方案会出现错误:

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?

除了终止 devenv.exe 进程并完全重新启动 Visual Studio,我找不到任何方法来解决这个问题。有什么更快更不严重的吗?

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

(微软声称在 2005 年修复了这个错误,但我在 VS2008 中遇到了它。)

回答by Mark Hurd

I'd look for msbuildprocess(es) to kill before devenv. And make sure vbcreally has gone too.

我会先寻找msbuild要杀死的进程devenv。并确保vbc真的已经过去了。

And as the comments say, try using msbuildyourself.

正如评论所说,尝试使用msbuild自己。

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 msbuildor vbcprocesses to kill. If anyone gave or gives me a +1 because they didfind a stuck msbuildor vbcprocess, please comment that this was the case too.

看到我从这里得到了一个 Nice Answer 徽章,我觉得我应该在下面强调我的评论:在我发生这种情况的所有情况下,没有msbuild或没有vbc进程可以杀死。如果有人因为确实发现卡住msbuildvbc进程而给我或给我 +1 ,请评论说情况也是如此。

回答by Grengas

You can use a shortcut ctrl+break in VS, this should cancel build process.

您可以在 VS 中使用快捷键 ctrl+break,这应该会取消构建过程。

回答by Mike Upjohn

I see this error in Visual Studio 2013 Professional as well. I terminated devenv.exe through Task Manager.

我在 Visual Studio 2013 Professional 中也看到了这个错误。我通过任务管理器终止了 devenv.exe。

回答by Jay Patel

For Visual Studio 2015 or greater, in Menubar, under Build option, there is "cancel" option. This will stop the build.

对于 Visual Studio 2015 或更高版本,在菜单栏中的构建选项下,有“取消”选项。这将停止构建。

回答by Ton

S O L V E Dit!

解决了!

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.

在 VS2017 prof vs15.9.16 中遇到过这个问题。执行构建时,构建开始编译但从未完成。除'cancel'外,构建菜单项呈灰色。并且取消不起作用。使用不同的编译器工作! “终止进程”终止构建的唯一方法。

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.

将程序剥离到最低限度显示了真正的问题。在那里引用了挂起构建的 DLL。编译 DLL 并重新引用它们解决了问题。

回答by Abhay Dixit

sometime this problem also arise in VS2015. Following the same process (kill process) would work here too.

有时这个问题也会出现在 VS2015 中。遵循相同的过程(终止过程)也可以在这里工作。

回答by Ryan

I had this problem arise in VS2015. You can specifically kill the MSBuild.exe process without shutting down Visual Studio.

我在 VS2015 中出现了这个问题。您可以在不关闭 Visual Studio 的情况下专门终止 MSBuild.exe 进程。

回答by Nathan Scott

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.

我今天在使用 VS2019 (16.4.2) 时遇到了这个问题。我的情况是我开始发布 - 它是一个数据库项目 - 并改变了主意,因此使用 Ctrl+Break 取消了发布。构建显示成功完成,发布未开始。发布是灰色的,由于这个错误,我无法退出 VS。我没有运行 msbuild 或 vbc 进程。我的解决方案是终止 devenv 进程。