How to scan and merge dotnet and not dotnet projects using Sonar LTS

Hi Team,

Is there a way where we can use sonar scanner for non DotNet Projects and SonarScannerforMSBuild for dotnet Projects and then merge this report in to one single project post analysis ? Because we are having may non dotnet repos that is not the part of the Solution which are as the part of same project, so we need to have this scanned in one single project, Can you suggest the best way on how we can achieve this please ?

upto 6.7.5 sonar-scanner use to scan both dotnet and non dotnet code base but from 7+ we are not getting the dotnet files during the scan process,

Hi,

It sounds like you’re looking for Applications. An application is a synthetic project made up of multiple projects. They’re available starting in Developer Edition($).

 
HTH,
Ann

Hi Ann,

So is there no way we can do it in community edition ? why this feature got moved out from 7+ ?

Hi,

Using two different scanners to run two different scans and then combine the output was never in 7+. Now if you want to run one analysis of everything, that will result in a unified project. And if so, this thread might be useful to you:

 
Ann

Hi Ann,

For you, the trick to getting everything in one go is to is to start with the SonarScanner for .NET, and then make sure a project references all the other files. I’ve had success before with syntax like this in a .csproj file:

<ItemGroup>
 <Content Include="src\**\*.js"/>

From the link you have provided, Just want to understand and confirm “is that references of all the other files” needs to be done in the code or this can be passed as the paramenters while executing the sonarscanner for MsBuild ?

Hi,

For .NET, analysis properties are read from the code/project and its build. So it’s your build that needs to know about all the files, not just the C# ones. That’s why I mentioned putting that in a .csproj file.

 
:wink:
Ann