Search code examples
sonarlintsonarlint-vs

SonarLint.xml is added to every VS project? Where can I read about it?


When I integrated SonarLint into my VS solution, I got a SonarLint.xml file ref. for every project. I wonder, how it is used? Can I remove this reference? Couldn't find any documentation about it.


Solution

  • When I integrated SonarLint into my VS solution, I got a SonarLint.xml file ref. for every project.

    This is needed and by-design. The file contains code quality rule parameters used by SonarLint. Example parameter:

    <Rule>
      <Key>S103</Key>
      <Parameters>
        <Parameter>
          <Key>maximumLineLength</Key>
          <Value>200</Value>
    

    When you bind or update your solution from SonarQube, a master SonarLint.xml file gets downloaded into your solution's .sonarlint folder; and a soft-link file to this master file is added to every project being analyzed.

    (The SonarLint NuGet apparently does not or cannot access the master SonarLint.xml file, so it needs a project-level SonarLint.xml soft-link file.)