New Install: warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.DoNotHideBaseClassMethods cannot be created

tfs

(Patrick Delaney) #1

Forgive me I am a SonarQube newbie… So I got the system communicating this morning, but now I had a chance to look at the build logs. Even though the build was successful and I can see entries in SonarQube, I’m wondering what these errors mean and if I should be concerned. I have attached the Build.txt log incase you want to see everything.

2018-08-02T22:46:53.2628384Z ##[warning]CSC(0,0): Warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.ThreadStaticWithInitializer cannot be created from C:\Users\Administrator\AppData\Local\Temp\1\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
2018-08-02T22:46:53.2628384Z      2>CSC : warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.ThreadStaticWithInitializer cannot be created from C:\Users\Administrator\AppData\Local\Temp\1\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [C:\Agent\_work\3\s\TestAppForPD\TestAppForPD.csproj]
2018-08-02T22:46:53.2628384Z ##[warning]CSC(0,0): Warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.MutableFieldsShouldNotBePublicReadonly cannot be created from C:\Users\Administrator\AppData\Local\Temp\1\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
2018-08-02T22:46:53.2628384Z      2>CSC : warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.MutableFieldsShouldNotBePublicReadonly cannot be created from C:\Users\Administrator\AppData\Local\Temp\1\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [C:\Agent\_work\3\s\TestAppForPD\TestAppForPD.csproj]
2018-08-02T22:46:53.2628384Z ##[warning]CSC(0,0): Warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.GetHashCodeEqualsOverride cannot be created from C:\Users\Administrator\AppData\Local\Temp\1\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
2018-08-02T22:46:53.2628384Z      2>CSC : warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.GetHashCodeEqualsOverride cannot be created from C:\Users\Administrator\AppData\Local\Temp\1\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [C:\Agent\_work\3\s\TestAppForPD\TestAppForPD.csproj]
2018-08-02T22:46:53.2628384Z ##[warning]CSC(0,0): Warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.CallToAsyncMethodShouldNotBeBlocking cannot be created from C:\Users\Administrator\AppData\Local\Temp\1\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
2018-08-02T22:46:53.2628384Z      2>CSC : warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.CallToAsyncMethodShouldNotBeBlocking cannot be created from C:\Users\Administrator\AppData\Local\Temp\1\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [C:\Agent\_work\3\s\TestAppForPD\TestAppForPD.csproj]
2018-08-02T22:46:53.2784390Z ##[warning]CSC(0,0): Warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.FrameworkTypeNaming cannot be created from C:\Users\Administrator\AppData\Local\Temp\1\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
2018-08-02T22:46:53.2784390Z      2>CSC : warning CS8032: An instance of analyzer SonarAnalyzer.Rules.CSharp.FrameworkTypeNaming cannot be created from C:\Users\Administrator\AppData\Local\Temp\1\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [C:\Agent\_work\3\s\TestAppForPD\TestAppForPD.csproj]

1_Build.txt (514.7 KB)

Thoughts?

Thanks for all the help so far.


(Amaury Levé) #2

Hi @patdelaney,

Most likely you don’t have the correct version of MSBuild installed on your machine. The version of SonarC# you are using requires at least the update 3 of MSBuild 14/Visual Studio 2015.

Could you check out you do have this version installed on your machine?

Cheers,
Amaury


(Patrick Delaney) #3

Here is what I have installed on the build server. I pulled this from the Capabilities section of the agent:
msbuild


(Amaury Levé) #4

Hi,

Sadly we cannot tell appart the update version of MSBuild just by looking at the first 2 version numbers. You need to ensure to install either Visual Studio 2015 Update 3 or Build Tools 2015 Update 3.

When running msbuild /? you should have a line equivalent to Microsoft (R) Build Engine version 14.0.25420.1. If you don’t have this version then you need to update.

Cheers,
Amaury


(Patrick Delaney) #5

Here is the output of msbuild /version

C:\Program Files (x86)\Microsoft Visual Studio 14.0>msbuild /version
Microsoft ® Build Engine version 14.0.23107.0
Copyright © Microsoft Corporation. All rights reserved.

14.0.23107.0
C:\Program Files (x86)\Microsoft Visual Studio 14.0>


(Colin Mueller) #6

Patrick,

That version maps to the RTM of Visual Studio 2015 / Build Tools 2015. You need to update to Visual Studio 2015 / Build Tools 2015 Update 3 or later

Colin


(Patrick Delaney) #7

OK I am doing that now.


(Volkan) #8

Hi Amaury,

I have the same problem but I had already downloaded MSBuild_14.0 on our test server from the link you provided and found this page after having the same problem. Today I’ve downloaded again from the link you provided and I checked that the file version is still 14.0.23107.10

On my local PC, I don’t have this issue since I have VS 2015 Update 3 installed. How can I upgrade to Build Tools 2015 Update 3 without installing VS?


(Amaury Levé) #9

Hi @veruyandi,

The version you are mentioning (i.e. 14.0.23107.10) matches the version of Build Tools 2015 no update. As @ColinHMueller said you need to be on Update 3 (i.e. 14.0.25420.1).


(Volkan) #10

Thanks Amaury, but I already got that. May be I was a bit unclear, but in short, from the link you provided, I can only install Build Tools 2015 no update, not the update 3.

After some search, I found what I look for and will share it here in case anybody has the same issue.

Build Tools 2015 Update 3
https://go.microsoft.com/fwlink/?LinkId=615458

Reference: https://github.com/Microsoft/msbuild/issues/480