无法在 Visual Studio 2017 中复制文件 .exe

Tia*_*ila 4 c# asp.net visual-studio asp.net-core visual-studio-2017

我有一个引用 .NET Framework 的 asp.net 核心项目,我使用的是 Visual Studio 2017 Enterprise。当我尝试构建我的解决方案时,我遇到了这个错误:

Unable to copy file "obj\Debug\net461\MyProject.exe" to "bin\Debug\net461\MyProject.exe". 
Access to the path 'bin\Debug\net461\MyProject.exe' is denied.
Run Code Online (Sandbox Code Playgroud)

即使我清理了解决方案并重新构建,我仍然有这个错误。

有人遇到过这个错误吗?

Ott*_*tak 6

转到任务管理器并查找 Microsoft vshost .exe 并将它们全部杀死。即使您停止调试,exe 也可以继续在后台运行。这会导致文件锁定。