title: dotnet.exe locking SonarScanner.MSBuild.Common.dll
body: <p>Good evening,</p>
  
  <p>I am using the .Net Core 2.0 version from here <a href="https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild" rel="noreferrer">https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild</a> on a 2.1 project in Jenkins with: </p>
  
  <pre><code>withSonarQubeEnv('SonarQubeMain') {
      bat "dotnet ${globals.SONAR_QUBE_MSBUILD_PATH}\\SonarScanner.MSBuild.dll begin /k:\"${globals.SONAR_QUBE_PROJECT}\" /d:sonar.host.url=${globals.SONAR_HOST_URL} /d:sonar.cs.xunit.reportsPaths=\"XUnit.xml\" /d:sonar.cs.opencover.reportsPaths=\"coverage.xml\"
  }
  
  bat "dotnet build --version-suffix ${env.BUILD_NUMBER}"
  
  dir('test/mytestprojecthere') {
      bat 'D:\\OpenCover\\OpenCover.Console.exe -target:"c:\\Program Files\\dotnet\\dotnet.exe" -targetargs:"xunit --no-build -xml XUnit.xml" -output:coverage.xml -oldStyle -filter:"-[*Tests*]*" -register:user'
  }
  withSonarQubeEnv('SonarQubeMain') {
      bat "dotnet ${globals.SONAR_QUBE_MSBUILD_PATH}\\SonarScanner.MSBuild.dll end"
  }
  </code></pre>
  
  <p>It works the first build but on the next build it fails with: </p>
  
  <pre><code>Failed to create an empty directory 'D:\Jenkins\workspace\xxxxxxxx\.sonarqube'. 
  Please check that there are no open or read-only files in the directory and that you have the necessary read/write permissions.
  
  Detailed error message: Access to the path 'SonarScanner.MSBuild.Common.dll' is denied.
  </code></pre>
  
  <p>and checking my windows server I can see multiple .Net Core Host Background process. If I kill these I can build again..</p>
  
  <p>I readed about msbuild <code>/nodereuse:false</code> for MSBuild but seems is not working for the dotnet core version?</p>