Exclude wwwroot from analysis

I need to exclude the wwwroot folder of my .netcore application.

Tried things like: sonar.coverage.exclusions="/wwwroot/" and also sonar.coverage.exclusions=“wwwroot” in the coverage exclusions section but the files are still being analysed.

Googled for days and not got anything to work up to.

Also tried adding it to my cs.proj like this:

<ItemGroup>
     <SonarQubeSetting Include="sonar.coverage.exclusions">
       <Value>src/Ui/wwwroot/**/*</Value>
     </SonarQubeSetting>
   </ItemGroup>

Please help.

Thanks, Dave.

So I’ve had to resort to adding wwwroot to my gitignore file. Not ideal.

Hi Dave,

It looks like you are using the wrong parameter to exclude the directory. What you probably want is to use sonar.exclusions, not sonar.coverage.exclusions.

You can have a look here for a good explanation: