Closed andrei-epure-sonarsource closed 2 years ago
I have the same (or similar) issue with .NET 6 Razor Class Libraries, where .csproj have <Project Sdk="Microsoft.NET.Sdk.Razor">
.
For each RCL project we have these logs:
No Code Analysis ErrorLog file found at /task/src/.sonarqube/out/8/Issues.json. ... INFO: Sensor C# Properties [csharp] WARN: Analyzer working directory does not exist: '/task/src/.sonarqube/out/8/output-cs'. Analyzer results won't be loaded from this directory. WARN: No Roslyn issues report found for this project. INFO: Sensor C# Properties [csharp] (done) | time=0ms
and looking at .sonarqube/out, the related folders all have an unexpected .tmp
suffix in the name (but all analysis files are there)
For Net5 razor projects there are two compilations one core and one razor. So, the core compilation creates the folders with numeric names then a task renames them to numeric.tmp. After it the razor compilation runs which creates again numeric names and after that compilation another task renames the numeric ones to numeric.razor and the numeric.tmp back to numeric. For Net6 the default behavior is to use SourceGenerators for razor projects and in that case there is only one compilation and our logic with folder renaming fails.
Until the issue is fixed, as a workaround the following property will disable the usage of SourceGenerators : <UseRazorSourceGenerator>false</UseRazorSourceGenerator>
Description
For a simple ASP .NET MVC 6 project, there are no metadata (e.g. LOCs, highlighting) and no issues imported in SonarCloud.
Repro steps
Please provide the steps required to reproduce the problem
Analyze https://github.com/andrei-epure-sonarsource/aspnet5mvc-reproducer (commit
917f627
) on SonarCloud. Make sure to rundotnet build --no-incremental .\AspNetCoreMvc5.sln
to rebuild.See the report - no metrics, no issues. The same project, if we change
net5
as Target Framework in the csproj will have issues and metrics - see here).Expected behavior
Should import issues and metrics.
Actual behavior
Please note that the console logs does contain the issues for .NET 6 , they just don't get reported. This makes this issue very similar to #1040.
However during the end step
Known workarounds
None.
Related information