Last analysis `AZL7uxb_z7q_973Ns8s4` failed

Why did my analysis fail? It failed with AZL7uxb_z7q_973Ns8s4

Along with AZMAnKeY_3toJT-dxPhl as well

Hello @lostfields,

Thank you for your feedback.

This is the error we can see on our side (in both cases):

ERROR: File xxx/log4net.config can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

This usually means you tried to configure sonar.sources and sonar.tests properties (or the associated inclusions/exclusions properties) in .sonarcloud.properties file. As mention in the error, you have to be sure that any resource is only included once as source or test.

In case you need more help you can send us the .sonarcloud.properties file and we’ll take a look.

Hmm. Can’t say that makes any sense. If AZMaDb3CEVoiT8HChL-F is the same issue I don’t know how to set it up.

It’s a dotnet project, where we have 3 projects, where two of them have log4net.config along with a project itemgroup where we have set CopyToOutputDirectory to “Always” for log4net.config

.
├── Api
│   ├── Api.csproj
│   └── log4net.config
├── Tests
│   ├── Tests.csproj
│   └── log4net.config
├── Worker
│   ├── Worker.csproj
│   └── log4net.config

The file .sonarcloud.properties looks like this:

# Path to sources
sonar.sources = .
sonar.exclusions = Tests/**/*

# Path to tests
sonar.tests = .
#sonar.test.exclusions = 
sonar.test.inclusions = Tests/**/*

# Source encoding
#sonar.sourceEncoding=UTF-8

# Exclusions for copy-paste detection
sonar.cpd.exclusions = Tests/**/*

Hi @lostfields

The error for analysis AZMaDb3CEVoiT8HChL-F is similar but not on the same file.

ERROR: File Tfso.License.Tests/LicenseControllerTests.cs can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

May I ask you to try to remove the entire .sonarcloud.properties file and see if the analysis is working as expected? We normally have a built-in mechanism for .NET projects to identify test projects.

When I remove the file and add the paths in UI it work as expected, but it feels a bit strange that we have nodejs projects working fine with .sonarcloud.properties but .NET doesn’t.