Sonar Cloud MSBuild Tasks Dll Getting Locked on Azure Devops

I’m running into an issue where I get random locking of the sonarqube msbuild tasks dll. This halts prevents an future pipelines from running until I restart my CI server.

##[error]One or more errors occurred. (One or more errors occurred. (Access to the path 'C:\agent\agent_01\_work\1\.sonarqube\bin\SonarScanner.MSBuild.Tasks.dll' is denied.))

"Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)"

We are using the SonarCloud (1.30.1) azure devops plugin and the associate pipeline tasks that come out of box with that plugin.

There have been a number of bug fixes to the SonarScanner for MSBuild relating to file locking. However, since you are using the Azure DevOps SonarCloud task you should have an up to date version of the Scanner.

It looks like to are running self-hosted agents. Are you running multiple agents on the same physical machine?

There are a couple of things you could try:

  • make sure you are running the latest versions of the build agent
  • try passing /nr:false to the MSBuild step that is doing the analysis. That should reduce the time file locks are held.
1 Like

This topic was automatically closed after 11 days. New replies are no longer allowed.