[英]Visual studio build fails while copying files to the bin directory due to file locks by vmwp.exe
I'm running my development environment in Docker containers.我在 Docker 容器中运行我的开发环境。 Since I have done some updates I'm now experiencing some difficulties when trying to rebuild my project that's running in my Docker container.
由于我已经完成了一些更新,因此在尝试重建在 Docker 容器中运行的项目时遇到了一些困难。
My project is running in a Windows Server Core Docker container running IIS, and I'm running the project from a shared volume on my host.我的项目在运行 IIS 的 Windows 服务器核心 Docker 容器中运行,并且我正在从主机上的共享卷运行项目。 I'm able to build the project before starting the docker container, but after the docker container is started the build fails with the following error:
我能够在启动 docker 容器之前构建项目,但是在启动 docker 容器之后构建失败并出现以下错误:
Could not copy "C:\path\to\dll\name.dll" to "bin\name.dll". Exceeded retry count of 10. Failed. The file is locked by: "vmwp.exe (22604), vmmem (10488)"
It seems that the Hyper-V process is locking the DLL files.似乎 Hyper-V 进程正在锁定 DLL 文件。 This clearly wasn't the case before and this seems to be related to some Docker or Windows updates I have done.
这显然不是以前的情况,这似乎与我所做的一些 Docker 或 Windows 更新有关。 How can I solve this issue?
我该如何解决这个问题? Do I need to change the process of building the application and running it in my Docker containers?
我是否需要更改构建应用程序并在我的 Docker 容器中运行它的过程?
I have been searching for a while now, and I can't find much about this specific issue.我已经搜索了一段时间,但我找不到太多关于这个特定问题的信息。 Any help would be appreciated.
任何帮助,将不胜感激。 Thanks in advance!
提前致谢!
I've run in the similar problem.我遇到了类似的问题。 Solved by stopping/removing the running application container from docker-for-windows interface.
通过从 docker-for-windows 界面停止/删除正在运行的应用程序容器来解决。
docker rm -f
will also do. docker rm -f
也可以。
On physical machine two vmxxx(lower and higher PID)(don't remember the name exactly) processes was keeping *.dll file(the build was going on docker side where build tools 2019 was used).在物理机上,两个 vmxxx(较低和较高 PID)(不记得确切名称)进程保留 *.dll 文件(构建在 docker 端进行,其中使用了构建工具 2019)。
Potential solution:潜在的解决方案:
Both vmxxx processes keeping those two dll files during build on docker.两个 vmxxx 进程在 docker 上构建期间保留这两个 dll 文件。 One vmxxx had higher number of PID and second had lower number of PID.
一个 vmxxx 的 PID 数量较多,而第二个 vmxxx 的 PID 数量较少。
Isolation should take care of processes when you build project from docker container.当您从 docker 容器构建项目时,隔离应该注意流程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.