Support multiple SonarCloud projects in a single Rider solution


we are using SonarCloud to find issues in our code, which works quite well. Our project is a SPA: an ASP.NET Core Backend with an Angular frontend. We have two SonarCloud projects, one for the backend and one for the frontend.

We are using Rider to work on both the backend and the frontend. However, we are unable to use SonarLint for both the backend and the frontend.

I was pleasantly surprised when i saw that SonarLint would support that kind of workflow:
SonarLint for IntelliJ 6.1 released - Bind individual modules to SQ/SC, C++ 20 rules, regexp rules for JS/TS and PHP - SonarSource Updates / Releases - SonarSource Community

However, from what I can tell, the concept of modules does not exist in Rider. Instead our frontend is an attached folder to our backend solution (Right-click solution → Add → Attach existing folder). Can you support this configuration as well, or suggest an alternative way of having both our frontend and backend in the same Rider instance which enables us to use SonarLint for both?

Thanks in advance,
A. Bittner

1 Like


As you discovered, unlike other JetBrains IDEs, Rider is not using the concept of modules. A Solution having multiple project will appear from API point of view as a single Intellij Project, having a single IntelliJ module (named rider.module).
That’s why we were not able to support overriding the binding at “MSBuild project” level.

I gave a try to “attach existing folder” feature, and it seems it doesn’t create a separate module as well. Analyzing a file from this attached folder still consider it to be part of the rider.module module.

On our side, we store the binding metadata as IDE settings, and IntelliJ APIs only offer Project (=Solution) level or Module level storage. To support you case, we would need an even more advanced binding configuration where one could override the binding per folder.

I will add an entry with your use case in our insight tracking system, but to be honest it looks quite specific, and a bit costly to implement, so don’t put too much hope on it :slight_smile:

I’m sorry I don’t see any way for now. You can use SonarLint and bind to one of the two SonarCloud projects, but it means issue suppression and a few other connected mode features will not work for files that are part of the second project.

Ah okay, that’s unfortunate then.

I’m surprised to hear it seems complicated to implement, from what I can tell attached folders are simply an entry in the indexLayout.xml file, but then again I have no experience with the IntelliJ plugin system.

Thanks for considering and putting it on your backlog though!

Kind regards,
A. Bittner

We have a similar use case: Our Solution contains .NET projects from different parts of the product family, which have different rulesets applied. With the Visual Studio SonarLint plugin, it is possible to have different rules per project.

Hi @MarkusSchaber

I think your case is a bit different since I understand you want to have different bindings for projects that are part of the same solution, while @abittner was referring to attached folders.
Still I think we can keep that in the same feature request, so many thanks for sharing your use case.

I will move this thread to the feature request category so that other interested people can vote.

1 Like