AspNetCore6.0 razor view compilation doesn´t work with sonarcloud

We have a AspNetCore web application which we have currently updated to .net6.0. These update does not work over our Azure-DevOps build pipeline. After deep investigation we found out that it could be the case that sonarcloud infers with the new razor views Changes to the ASP.NET Core Razor SDK.
These razor view compilation change affects where the razor views are compiled into. So by now the razor views are compiled in the same *.dll as the web app itself. If we disable sonarcloud for our pipeline then we see the compiled razor views in our *.dll artifact. With sonarcloud enabled we didn´t see these razor views compiled into the *.dll.

Please find the build logs for our E2E project attached. I added two files one verbose build with sonarcloud enabled the other one without sonarcloud enabled which results in fact into two differnet *.dll files. (1.5 MB)

We use the same Azure-DevOps tasks as mentioned in Enabling SonarCloud in Az-DevOps pipeline cause dotnet unit test to be slow.

Does someone report a related weird bug regarding that yet? Can you check the logs and test you sonarcloud static analyzing with aspnetcore 6 mvc project to see if the razor views are compiled as expected. If you need anything else please let me know.

TIA, Simon

Hello @planbsim

We are aware of No metrics or issues are imported for a ASP .NET 6 MVC project, which we fixed in version 5.5.0 (releases).

Could you please analyze your project with the scanner for .net 5.5.1 and confirm it works?

Note: It hasn’t been deployed yet to the Azure DevOps extension because we need to do another bugfix for an unrelated regression (see here), we’re currently working on it.

Thanks for your reply.

It could be the case that the metrics are not imported by now, however, in our case sonarcloud corrupts the dll (aspnetcore 6 mvc razor) in a certain way so that it is broken and can´t be executed anymore.

Would it be possible to create a small reproducer and share it with us?

If you use the workaround of adding the <UseRazorSourceGenerator>false</UseRazorSourceGenerator> property to your project, does it still behave the same way?

Do you still have the error @planbsim ? If yes, could you help us with a reproducer?