Sonarscan for DotNet project V2.1

I tried to run the sonar-scanner from docker (latest and oldest tag available right now) of the DotNet V2.1 project where am getting the below error,

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

I know we are using the deprecated version, But is there any possible way to run this?

Hey there.

You can’t use the SonarSource/sonar-scanner-cli docker image for .NET projects.

NB: These Docker images are not compatible with C/C#/C++/Objective-C projects.

You’ll need to use the SonarScanner for .NET.