Your project contains C# files which cannot be analyzed with the scanner you are using

I am running sonarqube:latest in a Docker container locally on my development machine to get some stuff working.

I’m trying to analyze a C# project that runs on .NET Core 3.1. Looking at this page I assumed I could use the .NET Core Global Tool to scan it but that gives me the following error while running the end step:

WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see

This also happens when I try to use .NET 5 dotnet <path to SonarScanner.MSBuild.dll> etc. It does nicely scan all the TypeScript and CSS stuff that’s in my project but in the end there are no C# results in SonarQube.

Any idea what I’m doing wrong?


Welcome to the community!

Can you provide your exact analysis and build commands?


I’m using the .NET global tool dotnet-sonarscanner to run the analysis:

dotnet sonarscanner begin /k:"project-key"  /d:sonar.login="myAuthenticationToken" /d:""=http://localhost:9000
dotnet build 
dotnet sonarscanner end /d:sonar.login="myAuthenticationToken"

I’ve also asked this question on Stack Overflow where I already have some more info: c# - Failing SonarQube analysis on .NET Core 3.1 project - Stack Overflow.

Apparently having this setting in a Directory.Build.Targets file makes the analysis fail for at least some projects:

<Target Name="ChangeAliasesOfReactiveExtensions" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
    <ReferencePath Condition="'%(FileName)' == 'System.Interactive.Async'">

Removing this (and fixing the resulting build errors) still gives me the same warning when running it on the whole solution. So I know need to debug which project is giving problems and why that’s resulting in this warning.

Any pointers on how to do that or what could be the problem?


I’m already officially over my head here, & I’ve flagged this post internally for specialist help.



Any updates here.

I am facing the same error using Sonar 9.0.1 and .NET Sonar Scanner 5.2.2.



I think this may be relevant:


Thanks Ann! Let me take a look.


Really 9 hours ago … I am really blessed today …

Ok let’s wait.

The original problem from @Wouter_de_Kort was identified on the SO website to be coming from the custom value of ErrorLog property. This issue was created to address that:

The problem of @luismachadoreis most likely isn’t the same as the original one. Did you confirmed that you’re using RunAnalyzer or RunAnalyzerDuringBuild properties in your project? If not, I’d suggest to create a new thread for investigation and gathering more info.

I think we can close this thread.

I have the exact same issue as described above. Tried

dotnet build -p:RunAnalyzersDuringBuild=true

… but that didn’t change anything. Still getting the

WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see

… message

Hi @la3lma ,

We would need to see your dotnet build -v:d verbose log to identify the root cause. I can provide private thread if you cannot share it publicly.

I just gave up on this issue and moved in another direction but it has become relevant again. @Pavel_Mikula If you can explain to me what you need I’m more then happy to give all the logs and other stuff you need in a private thread. Would love to solve this because it’s our only blocker for using SonarCloud at the moment.

Hi @Wouter_de_Kort,

We plan to release Scanner for .NET 5.3 this week that fixes both issues mentioned above - explicit ErrorLog value and RunAnalyzers override.

Let’s wait for the release so you can try it with the new version to see if that fixes the problem or there’s something else to investigate.



Thanks, that’s great news!


Scanner for .NET 5.3.0 was just released. You can get it from your favorite source.

Extension for Azure DevOps will follow early next week.

1 Like


Using the new scanner I get the following when analyzing the C# files in our project:

WARN: No Roslyn issue reports were found. The C# files have not been analyzed. You can get help on the community forum:

Any idea what’s happening?


Hi @Wouter_de_Kort,

We’ll need to see build logs in verbose mode to investigate what’s going on.

I’ll open a private thread to share the logs.

Hi @Wouter_de_Kort,

Thank you for the logs. It turns out that we didn’t properly implement the user-provided ErrorLog value. Scanner 5.3.0 supports absolute ErrorLog paths but doesn’t support relative paths.

I’ve created an issue to support relative paths as well.

As a workaround, you can set ErrorLog to an absolute path with $(MSBuildProjectDirectory) property:


Thanks! Now everything seems to work ok!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.