带有VSTS的SonarCloud出现了重复的ProjectGuid错误:& quot; 00000000-0000-0000-0000-000000000000& quot; [英] SonarCloud with VSTS has error Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000"
问题描述
我们将SonarCloud添加到大型解决方案的构建管道中.仅分析了我们解决方案中的一个项目,但我们看到了此警告
We added SonarCloud to the build pipeline of a large solution. Only one project in our solution is analyzed but we see this warning
警告:以下项目没有有效的ProjectGuid,并且未使用有效的解决方案(.sln)构建,因此将跳过分析......
D:\ a \ 1 \ s \ MyApp \ MyApp.Entities \ MyApp.Entities.csproj,D:\ a \ 1 \ s \ MyApp \ MyApp.Core \ MyApp.Core.csproj,D:\ a \ 1 \ s\ MyApp \ MyApp.Mobile.Backend \ MyApp.Mobile.Backend.csproj,D:\ a \ 1 \ s \ MyApp \ MyApp.Entities \ MyApp.Entities.csproj,D:\ a \ 1 \ s \ MyApp \ MyApp.Core \ MyApp.Core.csproj,D:\ a \ 1 \ s \ MyApp \ MyApp.Web \ MyApp.Web.csproj
警告:重复的ProjectGuid:"00000000-0000-0000-0000-000000000000".SonarQube将不会分析该项目.项目文件:"D:\ a \ 1 \ s \ MyApp \ MyApp.Entities \ MyApp.Entities.csproj"
警告:重复的ProjectGuid:"00000000-0000-0000-0000-000000000000".SonarQube将不会分析该项目.项目文件:"D:\ a \ 1 \ s \ MyApp \ MyApp.Core \ MyApp.Core.csproj"
警告:重复的ProjectGuid:"00000000-0000-0000-0000-000000000000".SonarQube将不会分析该项目.项目文件:"D:\ a \ 1 \ s \ MyApp \ MyApp.Mobile.Backend \ MyApp.Mobile.Backend.csproj"
警告:重复的ProjectGuid:"00000000-0000-0000-0000-000000000000".SonarQube将不会分析该项目.项目文件:"D:\ a \ 1 \ s \ MyApp \ MyApp.Web \ MyApp.Web.csproj"
WARNING: The following projects do not have a valid ProjectGuid and were not built using a valid solution (.sln) thus will be skipped from analysis...
D:\a\1\s\MyApp\MyApp.Entities\MyApp.Entities.csproj, D:\a\1\s\MyApp\MyApp.Core\MyApp.Core.csproj, D:\a\1\s\MyApp\MyApp.Mobile.Backend\MyApp.Mobile.Backend.csproj, D:\a\1\s\MyApp\MyApp.Entities\MyApp.Entities.csproj, D:\a\1\s\MyApp\MyApp.Core\MyApp.Core.csproj, D:\a\1\s\MyApp\MyApp.Web\MyApp.Web.csproj
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:\a\1\s\MyApp\MyApp.Entities\MyApp.Entities.csproj"
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:\a\1\s\MyApp\MyApp.Core\MyApp.Core.csproj"
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:\a\1\s\MyApp\MyApp.Mobile.Backend\MyApp.Mobile.Backend.csproj"
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:\a\1\s\MyApp\MyApp.Web\MyApp.Web.csproj"
项目结构为
推荐答案
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ProjectGuid>{fc2f0da6-ddfe-67b2-8dae-eb292f55436f}</ProjectGuid>
</PropertyGroup>
您需要执行以下操作:->在文件扩展名为.csproj的文件中添加标签或标签"ProjectGuid",每个文件使用不同的Guid.
You need to do the following: --> Add tag or label 'ProjectGuid ' to your files with .csproj extension with a different Guid for each file.
查看代码(此代码不可执行)
VIEW CODE (this code is not executable)
->为了生成Guid,您可以从 https://www.guidgenerator.com/online-guid-generator.aspx
--> And for generate Guid, you can do it from https://www.guidgenerator.com/online-guid-generator.aspx
这篇关于带有VSTS的SonarCloud出现了重复的ProjectGuid错误:& quot; 00000000-0000-0000-0000-000000000000& quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!