Hi, I’ve setup our project and Sonar Scanner for MSBUILD via Jenkins plugin. The build passes in the end and I get a successful artifact but no
.cs files get analyzed, only
- SonarQube 8.2
- SonarScanner for MSBuild 126.96.36.19908 - .NET Fwk 4.6
- MSBuild 14.0.25420.1
- Project targets .NET 4.6.1
- Build node Windows Server 2016
I constantly get the following error in every project that I try to build:
CSC : warning AD0001: Analyzer 'SonarAnalyzer.Rules.CSharp.XmlExternalEntityShouldNotBeParsed' threw an exception of type 'System.IO.FileNotFoundException' with message 'Could not load file or assembly 'System.ValueTuple, Version=188.8.131.52, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'.
steps to reproduce
Run the build from Jenkins.
Probably happens because using the older MSBuild.
I haven’t found any workarounds, but have tried older versions of SonarScanner down to 3.0 and still the same behavior.
Any help would be appreciated!
The issue now seems to be solved by Installing .NET Framework Runtime 4.7.2.
Now I have another issue where it says that File does not exist in the analysis context.
I’m getting the following error now it seems it still does not submit analysis support for the
WARN: File 'E:\workspace\migrationtool\BusinessLayer\LogWebApplication\App_Start\BundleConfig.cs' referenced by the protobuf 'MetricsInfo' does not exist in the analysis context
I’ve found out the issue with the last problem as well and want to share it here if others get a similar problem.
Jenkins agent was installing itself in
C:\jenkins. Project were saved in
Now inside the
C:\jenkins folder there is a
workspace folder which is a link to the
E:\workspace. This works correctly for builds but confuses the Scanner since all source
.cs files get the path from the
This is solved by changing that jekins build node directory is
E: now workspace is available directly without going trough any symlinks.
It seems that there is an issue with SonarScanner in this scenario when using symlinks in Windows.
thanks @nikola.vitanovic ! we opened an issue to track this problem https://github.com/SonarSource/sonar-dotnet/issues/3286