I get this kind of error sometimes in gitlab ci-cd worker log.
How can I fix it and set up parallel builds for MSVC projects?
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.8.4
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
The process cannot access the file because it is being used by another process.
I am curious how you invoke msbuild.exe, and maybe you have invoke multiple mbsuild.exe processes to correspond to the one-to-one construction projects.
If you simply receive external programs that interfere with msbuild.exe, before you faced this, you should open Task Manager to shut down any process with uses
msbuild.exe.If you just start multiple msbuild.exe processes under gitlab ci-cd and then face the issue(you already checked that there is no other programs using msbuild.exe under Task Manager), you have changed to use another function:
Create a file called
test.projfile and then use my method to add any project files(csprojfile) or solution files(slnfile) which you want to parallel built intotest.projfile. So that you only need to input oneprojfile into ci-cd.Use
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe xxx\test.proj -t:ParelBuildunder gitlab ci-cd.