Without setting it manually or removing reference to 'Microsoft.VisualStudio.TestPlatform.TestFramework', then the sonar-scanner-msbuild will categorize this project as TEST code/project. See categorization logic. This is what you will see if you don't manually set as Product/Main Project:
SonarCategoriseProject:
Sonar: (SomeConsoleApplication.csproj) Categorizing project as test or product code...
Sonar: (SomeConsoleApplication.csproj) project is evaluated as a test project based on the 'Microsoft.VisualStudio.TestPlatform.TestFramework' reference.
Sonar: (SomeConsoleApplication.csproj) categorized as TEST project (test code).
After:
SonarCategoriseProject:
Sonar: (SomeConsoleApplication.csproj) Categorizing project as test or product code...
Sonar: (SomeConsoleApplication.csproj) SonarQubeTestProject has been set explicitly to false.
Sonar: (SomeConsoleApplication.csproj) categorized as MAIN project (production code).
Without setting it manually or removing reference to 'Microsoft.VisualStudio.TestPlatform.TestFramework', then the sonar-scanner-msbuild will categorize this project as TEST code/project. See categorization logic. This is what you will see if you don't manually set as Product/Main Project:
After: