# SonarQube.Analysis.xml being ignored

**URL:** <https://community.sonarsource.com/t/sonarqube-analysis-xml-being-ignored/45087>\
**Category:** SonarQube Server / Community Build\
**Created:** [June 18, 2021, 11:38am UTC](https://community.sonarsource.com/t/sonarqube-analysis-xml-being-ignored/45087 "2021-06-18T11:38:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aspidistro](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@aspidistro](https://community.sonarsource.com/u/aspidistro)\
**Post date:** [June 18, 2021, 11:38am UTC](https://community.sonarsource.com/t/sonarqube-analysis-xml-being-ignored/45087/1 "2021-06-18T11:38:28Z")

</div>

Current software:  
Scanner sonarscanner-msbuild-netcoreapp30  
Sonarqube Version 6.7.6 (build 38781)

I’m new to Sonarqube. I’ve just started to run sonarscanner on a .Net Core C# application. The scan runs ok and the analysis is being shown on our corporate sonarqube site.

The solution has a UI project which contains javascript. I want to exclude those javascript files from the analysis

I’ve not been able to get that exclusion to work.

Can anyone suggest what I’m doing wrong?

I’ve added an exclusion to the begin statement (below) and since that didn’t work, also added SonarQube.Analysis.xml to the root of the folder structure (below).

Infrastructure-wise it’s running on jenkins, on a windows jenkins node with sonar scannere installed via chocolatey. Having said that, I have the same issue when running the scan on my local PC with the commands typed directly into powershell…

**begin statement**

```auto
dotnet "PathToSonarscanner\sonarscanner.msbuild.dll" begin /k:"projectkeygoeshere" /d:sonar.verbose=true /d:sonar.host.url="urlgoeshere" /d:sonar.login="loginkeygoeshere" /d:sonar.coverage.exclusions="**/*.js"

```

**SonarQube.Analysis.xml**

```auto
<?xml version="1.0" encoding="utf-8" ?>
<SonarQubeAnalysisProperties
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.sonarsource.com/msbuild/integration/2015/1">
  <Property Name="sonar.verbose">true</Property>
  <Property Name="sonar.host.url">urlgoeshere</Property>
  <Property Name="sonar.login">loginkeygoeshere</Property>
  <Property Name="sonar.projectKey">projectkeygoeshere</Property>
  <Property Name="sonar.sources">.</Property>
  <Property Name="sonar.coverage.exclusions">**/*.js</Property>
</SonarQubeAnalysisProperties>

```

---

<div class="post-metadata">

**Author:** ![duncanp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/duncanp/32/293_2.png) [@duncanp](https://community.sonarsource.com/u/duncanp)\
**Post date:** [June 18, 2021, 10:14pm UTC](https://community.sonarsource.com/t/sonarqube-analysis-xml-being-ignored/45087/2 "2021-06-18T22:14:00Z")

</div>

Hi @aspidistro - welcome to the community!

_sonar.coverage.exclusions_ stops files from being included in the calculation of code coverage.

_sonar.exclusions_ stops files from being analysed, which sounds like what you are looking for.

---

<div class="post-metadata">

**Author:** ![AndrasAgocs](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@AndrasAgocs](https://community.sonarsource.com/u/AndrasAgocs)\
**Post date:** [June 19, 2021, 10:50pm UTC](https://community.sonarsource.com/t/sonarqube-analysis-xml-being-ignored/45087/3 "2021-06-19T22:50:15Z")

</div>

Try passing the settings file as a parameter to the scanner:

`dotnet sonarscanner begin /k:"PROJECT_KEY" /s:"SETTINGS_FILE_ABSOLUTE_PATH"`

When I was working on this a month or two ago I run into an issue, where the dotnet scanner was not be able to find the settings file using relative paths no matter where I’ve placed it, so do try to use the full, absolute path.

ps.: I’ve also noticed the scanner only read certain properties from the file, notably the ones that have a /d: parameter prefix when used as params, so eg. the project name, the project key and the project version did only work for me as command parameters (/n:, /k: and /v:) directly passed to the scanner on execution.
