CompilerServer: server failed - server rejected the request due to analyzer / generator issues 'analyzer assembly '/tmp/.sonarqube/resources/2/System.Runtime.CompilerServices.Unsafe.dll'

  • SonarScanner for Azure Devops 1.23.1
CompilerServer: server failed - server rejected the request due to analyzer / generator issues 'analyzer assembly '/tmp/.sonarqube/resources/2/System.Runtime.CompilerServices.Unsafe.dll' has MVID 'bd600ba8-23b5-4d45-ba63-f24457fa3be3' but loaded assembly 'System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has MVID '7c39e25e-0207-4f4b-aedc-1c131c046167', analyzer assembly '/tmp/.sonarqube/resources/2/System.Memory.dll' has MVID 'a5006ea2-ea34-4a8e-8c71-a2eb982aadc0' but loaded assembly 'System.Memory, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' has MVID 'bd34e6d8-6e57-4fa4-afbf-ec5404de38cf'' - 9178c913-469b-4ae3-8c3b-a7ba03c9042b
2 Likes

Getting this same thing after upgrading my build from VS2015 to VS2019. Tried enabling automatic binding redirect generation with no change.

1 Like

Hello @joopscheer

Does your analysis fail?

Hello and welcome to the community!

Please give us the following version information:

  • what is the version of SonarQube that you are using?
  • what version of MSBuild are you using?

And we’ll need the logs:

  • please give us the verbose output of the scanner commands (sonar.verbose=true extra parameter for the first step, and please attach the output of the first and last analysis step)
  • please give the output of running MSBuild in verbose mode (/v:d)

Version: SonarScanner for MSBuild 5.4

The build fails before running the code analysis. Googling around seems this has been an issue before with the SonarScanner.

Can we move this to a private conversation so I can share the build logs?

Maybe it has something to do with the directories that are involved.

/analyzerconfig:/azp/_work/_tool/dotnet/sdk/6.0.100/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_6_default.editorconfig /analyzer:/tmp/.sonarqube/resources/3/Google.Protobuf.dll /analyzer:/tmp/.sonarqube/resources/3/SonarAnalyzer.CFG.dll /analyzer:/tmp/.sonarqube/resources/3/SonarAnalyzer.CSharp.dll /analyzer:/tmp/.sonarqube/resources/3/SonarAnalyzer.dll /analyzer:/tmp/.sonarqube/resources/4/SonarAnalyzer.VisualBasic.dll /analyzer:/tmp/.sonarqube/resources/4/Google.Protobuf.dll /analyzer:/tmp/.sonarqube/resources/4/SonarAnalyzer.dll /analyzer:/tmp/.sonarqube/resources/2/SonarAnalyzer.Security.dll /analyzer:/tmp/.sonarqube/resources/2/System.Runtime.CompilerServices.Unsafe.dll /analyzer:/tmp/.sonarqube/resources/2/System.Memory.dll /analyzer:/tmp/.sonarqube/resources/2/Microsoft.AspNetCore.Razor.Language.dll /analyzer:/tmp/.sonarqube/resources/2/System.Numerics.Vectors.dll /analyzer:/tmp/.sonarqube/resources/2/System.Buffers.dll

As you can see, multiple resource directories. One of the directories is also mentioned in the error message.

 CompilerServer: server failed - server rejected the request due to analyzer / generator issues 'analyzer assembly '/tmp/.sonarqube/resources/2/System.Runtime.CompilerServices.Unsafe.dll' has MVID 'bd600ba8-23b5-4d45-ba63-f24457fa3be3' but loaded assembly 'System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has MVID '7c39e25e-0207-4f4b-aedc-1c131c046167', analyzer assembly '/tmp/.sonarqube/resources/2/System.Memory.dll' has MVID 'a5006ea2-ea34-4a8e-8c71-a2eb982aadc0' but loaded assembly 'System.Memory, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' has MVID 'bd34e6d8-6e57-4fa4-afbf-ec5404de38cf'' - e953d8f2-6f37-447f-9322-7386f27ac595

Hi
I gave you a private message, you can access it here.

We have the same issue using dotnet-sonarscanner and with SonarScanner for MSBuild (5.2). But there are much more of those errors with dotnet-sonarscanner (around 300 vs around 30 with SonarScanner for MSBuild for the same PR).

Hi @Andrei_Epure,
To add to my post above, our analysis does not fail, but I wonder if there is any impact on the analysis? Do you know if we might miss analysis for some code because of that?

Thank you!

Hi @lsokolova no, there is no impact on the results of the analysis.

I am running into the same issue.

CoreCompile:
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702 /fullpaths /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:XXXXXX\XXGlobal\bin\Debug\XXGlobal.dll /reference:XXXXXX\GRpc\XX\bin\Debug\XX.dll /reference:XXXXXX\XX.Common\bin\Debug\XX.Common.dll /reference:XXXXXX\XX\bin\Debug\XX.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\XXX.dll /ruleset:C:\agent\_work\3\.sonarqube\conf\Sonar-cs.ruleset /errorlog:C:\agent\_work\3\.sonarqube\out\7\Issues.json /subsystemversion:6.00 /target:library /warnaserror- /utf8output /deterministic+ /langversion:latest /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\0\Google.Protobuf.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\0\SonarAnalyzer.CFG.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\0\SonarAnalyzer.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\1\Google.Protobuf.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\1\SonarAnalyzer.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\1\SonarAnalyzer.VisualBasic.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\2\Microsoft.AspNetCore.Razor.Language.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\2\SonarAnalyzer.Security.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\2\System.Buffers.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\2\System.Memory.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\2\System.Numerics.Vectors.dll /analyzer:C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\2\System.Runtime.CompilerServices.Unsafe.dll /additionalfile:C:\agent\_work\3\.sonarqube\conf\cs\SonarLint.xml /additionalfile:C:\agent\_work\3\.sonarqube\conf\7\SonarProjectConfig.xml /additionalfile:C:\agent\_work\3\.sonarqube\conf\7\ProjectOutFolderPath.txt ..\Common\CommonAssemblyInfo.cs Enums\OOO.cs YYYY.cs Interfaces\IYYYY.cs Interfaces\IZZZZ.cs Interfaces\IUUUU.cs ABC.cs Properties\AssemblyInfo.cs ServiceConfiguration.cs "obj\Debug\.NETFramework,Version=v4.8.AssemblyAttributes.cs"
  
  CompilerServer: server failed - server rejected the request due to analyzer / generator issues 'analyzer assembly 'C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\2\System.Buffers.dll' has MVID '36e84b0d-9d74-4086-a062-54e1963f24d5' but loaded assembly 'System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' has MVID 'f389ca43-32bf-4e24-ad8c-a6ed5efddff3', analyzer assembly 'C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\2\System.Numerics.Vectors.dll' has MVID '95de52ab-0179-450a-9f6f-08d224d60b15' but loaded assembly 'System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has MVID '34905ed1-db9d-4250-b31b-b80e1ff70ff5', analyzer assembly 'C:\Users\XX\AppData\Local\Temp\.sonarqube\resources\2\System.Runtime.CompilerServices.Unsafe.dll' has MVID 'bd600ba8-23b5-4d45-ba63-f24457fa3be3' but loaded assembly 'System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has MVID '9dde2c5e-b52a-4cbd-861e-9aacf36593ce'' - f7abc89f-5b0d-4064-b0ad-4b0a231999f1

Messages like this are spammed very often during this build. Strangely, also the build times are exploding on this build. There are 2 compile steps in the build, that usually take roughly 1 minute and a few seconds. With SonarQube enabled they take more than 21 and 26 minutes, exceeding the build time limit (its a build per commit situation so an hour build time is not acceptable) causing it to fail.

We are talking about a DevOps project (self hosted agent) with 2 .NET solutions being built in that build, using the SonarQube DevOps Pipeline Plugin.

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