I have two .NET solutions, one is in .NET 5 and other is in .NET Classic 4.7.2. Each solution has separate Jenkins build job. Each job also analyze the solution using SonarQube's MSBuild scanner.
I am using SonarQube Server version 8.5
Scanner for .NET 5 sonar-scanner-msbuild-5.1.0.28487-net5.0
Scanner for .NET 4.7.2 sonar-scanner-msbuild-4.10.0.19059-net46
Issue
In Jenkins, When .NET 5 build is running, and at the same time if I execute another .NET Classic build then the latter one fails with the error
C:\Users\jenkinsuser\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets(62,5): error : The build is configured to run SonarQube analysis but the SonarQube analysis targets could not be located. Project: MyProject.csproj
I think the issue here is both scanners are sharing same location to store targets, so the latter one fails. I think have two options here
1>Is there anyway to run one job at a time in Jenkins without using any third party plugin? In Maven Project Configuration there is # of executors
currently set to 3. Will changing this to 1 execute only one job at a time? Are there any side effects changing this value to 1.
2>In Sonar Scanner is there any property I can set on each scanner, so that scanner would use different location for targets