How do we troubleshoot this msbuild error MSB6003?
We have a moderately large C++ codebase that builds with VS2017 (15.9.19 - I know, we're well behind on updates to VS). We are getting intermittent build failures with this error:
error MSB6003: The specified task executable "CL.exe" could not be run. The requested operation cannot be performed on a file with a user-mapped section open.
(Sometimes the error will be that the linker could not run, also with the user-mapped section message). The error happens at random; it doesn't happen with a specific file or even project in the solution, and our current workaround is to just run the build again.
We suspected that the error may have been caused by our security software deciding to scan files during the build and being starved by the amount of cpu use from the build itself, so we have tried reducing the amount of parallelism the build uses and that reduced the frequency of the errors but has not eliminated the problem. Again, that was based on hunches, we didn't have concrete evidence that that was the problem.
How do we troubleshoot this error properly? If we start with the message itself, which file is it saying had a user-mapped section open: CL or a file that it was trying to access?