.CSHTML Support over sonarqube

We have our application, which is mainly built using CSHTML, and analyzing cshtml are essential for our business. it is really helpful if you could add a new feature to analyze cshtml. or please share if there is any way to analyze cshtml files.

Hi @vishnu ,

SonarQube can analyze *.cshtml files just fine. Which version of SonarQube are you using? Which version of .NET is your project? And how are you analyzing the code currently?

1 Like

Hi Chris,

I have found the issue it’s with SonaLint for visual studio. for VS Code it is working fine. even I can see the code smells, warnings, vulnerabilities, over SonarQube.

Framework : .Net 4.7
SonarLint Version : SonarLint 5.4

Hi @vishnu

We analyse the C# in cshtml as part of the security analysis but not for code quality rules as these files should contain minimal amounts of C# code. In Sonarlint for VSCode the cshtml files are analysed for html issues but not C# ones, this is currently not the case in Visual Studio which is why you are seeing no issues.

We are considering extending full analysis to cshtml files in the future. To help me understand the need, what types of issues are you concerned about in your cshtml?


Thank You, Tom, That’s the Good information from you and now I have an idea how sonar lint works over the visual studio. I wish SonarLint cover the entire CSHTML not specific to C# .