Access denied when executing a build with build-wrapper-win-x86-64.exe and MSBuild\15.0\Bin\MSBuild.exe on windows 10

Versions:

  • Sonar version is 8.2, professional edition, SQLServer database. Both are fresh installations.
  • sonar-scanner-msbuild-4.7.1.2311 or sonar-scanner-msbuild-4.8.0.12008 (same result)
  • plugins: sonar-cfamily-plugin-6.7.0.15300.jar and sonar-csharp-plugin-8.4.0.15306.jar
  • java jdk-11.0.6

Environment

  • windows 10
  • solution and sonar on the same machine
  • the solution mixes c++ and c# projects
  • I’ve admin credentials on the PC

** What’s working **

  • No problem to start sonar (startsonar.bat) and to access to the SQL Server database
  • Analysis went well a few hours before when I tried to analyze the soluton with the community edition (obviously only c# projects of the solution were analyzed), results correctly stored in the DB.

** Current situation **
Commands executed from a cmd window (opened in admin mode), from the folder containing the project

    1. E:\Projects\hoodbSolution>SonarScanner.MSBuild.exe begin /k:“hdb:develop” /d:sonar.cfamily.build-wrapper-output=“bw_output”
      SonarScanner for MSBuild 4.8
      Using the .NET Framework version of the Scanner for MSBuild
      Pre-processing started.
      Preparing working directories…
      23:18:35.654 Updating build integration targets…
      23:18:35.67 Fetching analysis configuration settings…
      23:18:36.295 Provisioning analyzer assemblies for cs…
      23:18:36.297 Installing required Roslyn analyzers…
      23:18:36.513 Provisioning analyzer assemblies for vbnet…
      23:18:36.515 Installing required Roslyn analyzers…
      23:18:36.549 Pre-processing succeeded.
    1. build-wrapper-win-x86-64.exe --out-dir E:\Projects\hoodbSolution\bw_output “C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe” E:\Projects\hoodbSolution\hoodbSolution.sln /t:Clean;Rebuild /p:Configuration=“Release” /p:Platform=“x64” /m
      Accès refusé. (means access denied)

Additionally, a window message is shown with “this application cannot run on your PC
To find an application for your PC, ask the software publisher.”

a) When executing “C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe” E:\Projects\hoodbSolution\hoodbSolution.sln /t:Clean;Rebuild /p:Configuration=“Release” /p:Platform=“x64” /m, the project is correctly built…
b) I’ve full control on the folder where sonarqube is installed (read, write, execution, etc.)
c) no error reported in the logs (sonar, web, ce, access or es)

did somebody experienced the same kind of trouble? Any recommendation or solution that works is welcome!

Hi @Yuypanqui,

why in admin mode? You shouldn’t need to be in admin mode.

Is it a 64bit machine?

Hi Massimo,
Thank you for taking care of this topic. A solution was found … stupid problem: an old version was installed on c: / program files / … and the first build-wrapper-win-x86-64.exe on the path was this one. Deleting it was THE solution.