Build Solution task fails after SonarQubePre task when using Fakes
See original GitHub issueI 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
Issue Analytics
- State:
- Created 7 years ago
- Comments:23 (7 by maintainers)
Top Results From Across the Web
Build Solution task fails after SonarQubePre task when using ...
I am building my solution using the Visual Studio Build task. The task right before it is the SonarQube for MSBuild - Begin...
Read more >Run Code Analysis task fails on Azure DevOps Server
2.Run build solution task successfully,; Run “Prepare analysis on SonaQube” successfully, here is output. Starting: Prepare analysis on ...
Read more >MSBuild Fakes Generation failing (SonarQube.Integration ...
This is the error that I get from a solution that generates Fakes assemblies ... then queue build with SonarQube tasks (Build definition:...
Read more >SonarQube fails to analyse when running CakeBuild on Jenkins
I have a Jenkins job that uses the SonarQube Jenkins plugin for analysis and CakeBuild to build the solution and run the tests....
Read more >SonarScanner for .NET | SonarQube Docs
The SonarScanner for .NET is the recommended way to launch an analysis for projects/solutions using MSBuild or dotnet command as a build tool....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
@CodersB reading the responses above, it looks like using the FolderDisambiguator option did work for zmckinnon. Alternatively, you can exclude specific projects from analysis - see https://stackoverflow.com/questions/32563682/how-to-exclude-ignore-referenced-projects-analysis-from-soanrqube