Sonarqube 如何使用Sonascanner分析.NET的混合版本

Sonarqube 如何使用Sonascanner分析.NET的混合版本,sonarqube,sonarqube-scan,sonarlint,Sonarqube,Sonarqube Scan,Sonarlint,版本 SonarQube8.5社区 扫描仪 sonar-scanner-msbuild-4.10.0.19059-net46. sonar-scanner-msbuild-5.1.0.28487-net5.0 在一个git存储库中,我们有两个.NET5解决方案、一个.NET4.7.2解决方案和一个.NetStandard2.0解决方案。.NETStandard项目被所有其他.NET项目(.NET 5和.NET 4.7.2)引用 我知道.NET4.7.2和.NET5有不同的扫描仪。我想知道,如果我

版本
SonarQube8.5社区

扫描仪
sonar-scanner-msbuild-4.10.0.19059-net46.
sonar-scanner-msbuild-5.1.0.28487-net5.0

在一个git存储库中,我们有两个.NET5解决方案、一个.NET4.7.2解决方案和一个.NetStandard2.0解决方案。.NETStandard项目被所有其他.NET项目(.NET 5和.NET 4.7.2)引用

我知道.NET4.7.2和.NET5有不同的扫描仪。我想知道,如果我使用各自的扫描器分析解决方案,但在两个扫描器中使用相同的项目密钥将两个扫描器指向同一个SonarQube项目,它会工作吗?或者第二次扫描会覆盖第一次扫描的结果吗

--Scan NET 5 solutions dotnet
 "C:\SonarQubeScanners\net5\SonarScanner.MSBuild.dll" begin /k:"MyProjectKey" /d:sonar.host.url="http://sonarqube.xyz.com" /d:sonar.login="myloginkey"      

  dotnet build Solution1.sln" 

  dotnet build Solution2.sln" 

"C:\SonarQubeScanners\net5\SonarScanner.MSBuild.dll" end /d:sonar.login="myloginkey" 
    
    
--Scan NET 4.7.2 solution   
C:\SonarQubeScanners\net46\SonarScanner.MSBuild.exe begin /k:"MyProjectKey" /d:sonar.host.url="http://sonarqube.xyz.com" /d:sonar.login="myloginkey" 
    
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" "Solution3.sln" /t:Rebuild /p:Configuration=Release 
    
C:\SonarQubeScanners\net46\SonarScanner.MSBuild.exe end /d:sonar.login="myloginkey" 
我试图避免创建两个单独的SonarQube项目,一个用于.NET 5解决方案,另一个用于.NET 4.7.2解决方案。

(为了更广泛的受众,在此重新发布)

使用相同的键进行两次分析将使它们相互覆盖。但是,您应该只能使用一个扫描仪来分析两个项目,如下所示:

用于编译.NET扫描器的风格(无论是.NET Framework、.NET Core还是.NET)与要分析的项目所使用的.NET版本无关

我只需要调用begin一次,编译两个项目,然后运行end一次

--Scan NET 5 solutions dotnet
 "C:\SonarQubeScanners\net5\SonarScanner.MSBuild.dll" begin /k:"MyProjectKey" /d:sonar.host.url="http://sonarqube.xyz.com" /d:sonar.login="myloginkey"      

  dotnet build Solution1.sln" 

  dotnet build Solution2.sln" 

"C:\SonarQubeScanners\net5\SonarScanner.MSBuild.dll" end /d:sonar.login="myloginkey" 
    
    
--Scan NET 4.7.2 solution   
C:\SonarQubeScanners\net46\SonarScanner.MSBuild.exe begin /k:"MyProjectKey" /d:sonar.host.url="http://sonarqube.xyz.com" /d:sonar.login="myloginkey" 
    
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" "Solution3.sln" /t:Rebuild /p:Configuration=Release 
    
C:\SonarQubeScanners\net46\SonarScanner.MSBuild.exe end /d:sonar.login="myloginkey"