Template for a good bug report, formatted with Markdown:
- Versions used
sonar-scanner-msbuild-5.0.4.24009-net46
Sonarcloud project using ruleset from Sonarcloud recomended - Error observed
18>CSC : warning AD0001: Analyzer 'SonarAnalyzer.Security.CSharp.UcfgGenerator' threw an exception of type 'System.ArgumentException' with message 'Inconsistent syntax tree features [C:\Users\hellm\source\repos\tc-iot-platform\Messify Management Portal\Messify Management Portal\Messify Management Portal.csproj]
Parameter name: trees'.
Exception occurred with following context:
Compilation: Messify.Presentation.ManagementPortal
System.ArgumentException: Inconsistent syntax tree features
Parameter name: trees
at Microsoft.CodeAnalysis.Compilation.SyntaxTreeCommonFeatures(IEnumerable`1 trees)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.Update(ReferenceManager referenceManager, Boolean reuseReferenceManager, SyntaxAndDeclarationManager syntaxAndDeclarations)
at SonarAnalyzer.Security.CSharp.UcfgGenerator.RazorViewMethodsForNetFramework(Compilation compilation, IEnumerable`1 razorDocuments)
at SonarAnalyzer.Security.CSharp.UcfgGenerator.CreateNetFrameworkMvcRazorViewUcfg(CompilationAnalysisContext endContext, IRazorPathProvider pathProvider)
at SonarAnalyzer.Security.CSharp.UcfgGenerator.<Initialize>b__16_10(CompilationAnalysisContext endContext)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c.<ExecuteCompilationActionsCore>b__48_1(ValueTuple`2 data)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info)
-----
Suppress the following diagnostics to disable this analyzer: S2076, S2078, S2083, S2091, S2631, S3649, S5131, S5135, S5144, S5145, S5146, S5167
- Steps to reproduce
Having a MVC and Web Api project on .NET Framework 4.6.2 which is quite huge we we getting this issue mentioned. Analyses still proceed but during inspection of logs this error is present - Potential workaround
N/A - Scanner command used when applicable (private details masked)
.\SonarScanner.MSBuild.exe begin /o:“xx” /k:“xx” /d:sonar.host.url=“https://sonarcloud.io” /d:sonar.login=“xx”