azure-pipelines-tasks: Build Solution task fails after SonarQubePre task when using Fakes
I am building my solution using the Visual Studio Build task.
The task right before it is the SonarQube for MSBuild - Begin Analysis.
I am using Microsoft Fakes with my project.
Sometimes (like every other time or so), I get the following error when building:
Error MSB3231: Unable to remove directory "F:\Agent-03\_work\1\.sonarqube\out\\f_AnyCPU_Release_4391". The process cannot access the file 'FilesToAnalyze.txt' because it is being used by another process.
Here are the logs: logs_40521.zip
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 23 (7 by maintainers)
Commits related to this issue
- SONARMSBRU-26: MS Fakes should be excluded from analysis — committed to SonarSource/sonar-scanner-msbuild by deleted user 9 years ago
@zmckinnon no, I’m afraid not. A tool like SysInternals Process Monitor might help pin it down.
Here’s a possible workaround: copy the following XML into a file (the name doesn’t matter) and dump it on the agent machine. The detailed explanation is in the file: the short version is that it attempts to guarantee that the per-project folder name is unique by using a guid.
You’ll be able to tell if the file is being used by looking for the text “FolderDisambiguator” in the build output.