You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building .NET Core app with Razor pages triggers two builds under the hood. First csc build generates Project.dll assembly, second csc build generates Project.Views.dll assembly.
We have special handling for this in our integration targets to set ErrorLogPropertyGroup to get Sarif report out of the analysis. Basically we want to get the main ErrorLog from first build and then, we want also the second ErrorLog from generating the Views.
While this was probably working for original versions of the RazorCoreCompile targets in .NET Core 2 SDK, there were some braking changes in Razor SDK 3.1 so we don't get the Sarif Report for Razor Views assembly anymore.
.NET Core 3.1 and .NET 5 Razor SDK target for RazorCoreCompile uses this Csc parameter:
ErrorLog="$(RazorCompilationErrorLog)"
Solution
We need to update our SonarQube.Integration.targets to set both properties to the same value:
Context
Building .NET Core app with Razor pages triggers two builds under the hood. First
csc
build generatesProject.dll
assembly, secondcsc
build generatesProject.Views.dll
assembly.We have special handling for this in our integration targets to set
ErrorLog
PropertyGroup
to get Sarif report out of the analysis. Basically we want to get the mainErrorLog
from first build and then, we want also the secondErrorLog
from generating theViews
.sonar-scanner-msbuild/src/SonarScanner.MSBuild.Tasks/Targets/SonarQube.Integration.targets
Lines 482 to 488 in 9329159
Problem
While this was probably working for original versions of the
RazorCoreCompile
targets in .NET Core 2 SDK, there were some braking changes in Razor SDK 3.1 so we don't get the Sarif Report for Razor Views assembly anymore..NET Core 3.1 and .NET 5 Razor SDK target for
RazorCoreCompile
uses thisCsc
parameter:Solution
We need to update our
SonarQube.Integration.targets
to set both properties to the same value:The text was updated successfully, but these errors were encountered: