Hi:
I am trying to set use MSBuild to scan a project following the instructions in https://sonarcloud.io/documentation/analysis/scan/sonarscanner-for-msbuild/
So if we consider the three steps proposed:
1. SonarScanner.MSBuild.exe begin /k:"project-key" /o:"<organization>" /d:sonar.login="<token>"
2. MSBuild.exe <path to solution.sln> /t:Rebuild
3. SonarScanner.MSBuild.exe end /d:sonar.login="<token>"
Since I am running this on a Macbook, step number 1 is:
mono <pathToSonarScanner.MSBuild.exe> begin /k:âMyProjectKeyâ /d:sonar.host.url="" /d:sonar.login=""
And this seems to work. Here is the output:
SonarScanner for MSBuild 4.6.2
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directoriesâŚ
17:10:39.917 Updating build integration targetsâŚ
17:10:39.953 Fetching analysis configuration settingsâŚ
17:10:40.519 Provisioning analyzer assemblies for csâŚ
17:10:40.519 Installing required Roslyn analyzersâŚ
17:10:40.956 Provisioning analyzer assemblies for vbnetâŚ
17:10:40.956 Installing required Roslyn analyzersâŚ
17:10:40.976 Pre-processing succeeded.
When I try to do the second step, which looks like this:
mono <pathToMsBuild.exe> <MySolution.sln> /t:Rebuild
I get the following output:
Unhandled Exception:
System.TypeInitializationException: The type initializer for âMicrosoft.Internal.Performance.CodeMarkersâ threw an exception. â> System.EntryPointNotFoundException: FindAtom assembly: type: member:(null)
at (wrapper managed-to-native) Microsoft.Internal.Performance.CodeMarkers+NativeMethods.FindAtom(string)
at Microsoft.Internal.Performance.CodeMarkersâŚctor () [0x00006] in <61d256b675144ee480c85be193028a64>:0
at Microsoft.Internal.Performance.CodeMarkersâŚcctor () [0x00000] in <61d256b675144ee480c85be193028a64>:0
â End of inner exception stack trace â
at Microsoft.Build.CommandLine.MSBuildApp.Main () [0x00028] in <61d256b675144ee480c85be193028a64>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for âMicrosoft.Internal.Performance.CodeMarkersâ threw an exception. â> System.EntryPointNotFoundException: FindAtom assembly: type: member:(null)
at (wrapper managed-to-native) Microsoft.Internal.Performance.CodeMarkers+NativeMethods.FindAtom(string)
at Microsoft.Internal.Performance.CodeMarkersâŚctor () [0x00006] in <61d256b675144ee480c85be193028a64>:0
at Microsoft.Internal.Performance.CodeMarkersâŚcctor () [0x00000] in <61d256b675144ee480c85be193028a64>:0
â End of inner exception stack trace â
at Microsoft.Build.CommandLine.MSBuildApp.Main () [0x00028] in <61d256b675144ee480c85be193028a64>:0
Can anyone help me understand what I am doing wrong?
Thank you in advance for any clues.
Miguel