Lately I have noticed the error WARNING: Duplicate ProjectGuid: The project will not be analyzed. on a number of the projects we are buidling in out CI/CD pipeline in Azure. It seems it only happens on a subset of the projects, 10 out of the total of 69.
14:16:58.926 14:16:58.926 WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed. Project file: "/home/vsts/work/1/s/src/[snip].csproj"
14:16:58.926 14:16:58.926 WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed. Project file: "/home/vsts/work/1/s/src/[snip].csproj"
14:16:58.926 14:16:58.926 WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed. Project file: "/home/vsts/work/1/s/src/[snip].csproj"
14:16:58.926 14:16:58.926 WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed. Project file: "/home/vsts/work/1/s/src/[snip].csproj"
14:16:58.926 14:16:58.926 WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed. Project file: "/home/vsts/work/1/s/src/[snip].csproj"
14:16:58.926 14:16:58.926 WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed. Project file: "/home/vsts/work/1/s/src/[snip].csproj"
14:16:58.926 14:16:58.926 WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed. Project file: "/home/vsts/work/1/s/src/[snip].csproj"
14:16:58.926 14:16:58.926 WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed. Project file: "/home/vsts/work/1/s/src/[snip].csproj"
14:16:58.926 14:16:58.926 WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed. Project file: "/home/vsts/work/1/s/src/[snip].csproj"
14:16:58.926 14:16:58.926 WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed. Project file: "/home/vsts/work/1/s/src/[snip].csproj"
According to This ticket this should not happen when you build a solution, but we build a solution:
The
<ProjectGuid>
element is not required if you build a solution (sln) containing that project
Also, as far as I can identify, the ProjectGuid is an obsolete property of csproj files.
Below the popeline we use:
- task: SonarCloudPrepare@1
displayName: 'Prepare analysis configuration'
inputs:
SonarCloud: 'SC'
organization: '---'
scannerMode: 'MSBuild'
projectKey: '---'
projectName: '---'
extraProperties: |
sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/*/coverage.opencover.xml
- task: DotNetCoreCLI@2
displayName: 'Build solution'
inputs:
command: 'build'
projects: '**/*.sln'
arguments: --configuration $(buildConfiguration)
- task: SonarCloudAnalyze@1
displayName: 'Run SonarCloud analysis'
- task: SonarCloudPublish@1
displayName: 'Publish results on build summary'
inputs:
pollingTimeoutSec: '300'