ERROR: Failed to make the following project runnable: This process cannot access the file ~/MyProject.exe' because it is being used by another process

ERROR: Failed to make the following project runnable: This process cannot access the file ~/MyProject.exe' because it is being used by another process

当我在 Visual Studio 2015 上尝试编译和 运行 我的 ASP.Net Core 1.0 项目时,出现以下错误:

无法使以下项目运行可用:MyProject(.NETFramework,版本=v4.6)原因:进程无法访问文件'~\MyProject.exe ' 因为它正被另一个进程使用。<br> 文件:C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets

我不知道为什么会出现这个错误。有什么解决办法吗?

这是一个实际有效的解决这个问题的愚蠢方法!我停止调试并关闭 Visual Studio。然后我重新启动了计算机。重新启动计算机后再次打开 Visual Studio 时,我能够 运行 应用程序而没有任何错误。

尽管应用程序已从 Visual Studio 停止,但该进程似乎仍在后台 运行ning。

来源:基本故障排除