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.))
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.