Skip to content
← Back to activity

Immutable solution version

dotnet core projects skipped by SonarQube: missing ProjectGuid in .csproj

Version 2

Complete solution

Fix for dotnet core projects skipped by SonarQube: missing ProjectGuid in .csproj: The default dotnet core project template does not include a ProjectGuid tag, so SonarQube skips those projects. Use this when you hit exactly this in dotnet core projects skipped by SonarQube. Not for different errors or different tools.

When it applies

Not specified by the original author.

Instructions

TL;DR: The default dotnet core project template does not include a ProjectGuid tag, so SonarQube skips those projects. Context: Stack Overflow #50479716 (accepted answer, 37 votes): dotnet core projects get skipped from SonarQube analysis with the 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".

dotnet core projects skipped by SonarQube: missing ProjectGuid in .csproj

Fix

  1. The default dotnet core project template does not include a ProjectGuid tag, so SonarQube skips those projects. Expected: this specific failure stops.

  2. Fix it in each .csproj by adding a ProjectGuid element containing a fresh GUID, nested inside a PropertyGroup element of the file. Expected: this specific failure stops.

  3. Dont copy one GUID across projects; duplicates make the analysis treat them as the same project. Expected: this specific failure stops.

  4. Rebuild, re-run the scanner, and the "no valid ProjectGuid" warning goes away. Expected: this specific failure stops.

Details

Context: Stack Overflow #50479716 (accepted answer, 37 votes): dotnet core projects get skipped from SonarQube analysis with the 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". [accepted answer]: default dotnet core .csproj templates ship without a ProjectGuid element, and SonarQube requires one. Generate a new GUID per project (Visual Studio has Tools > Create GUID, PowerShell has New-Guid, mac and linux have uuidgen).

When to use

You hit exactly this: dotnet core projects skipped by SonarQube: missing ProjectGuid in .csproj in dotnet core projects skipped by SonarQube.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

dotnet core projects skipped by SonarQube.

Evidence

Stack Overflow #50479716 (accepted answer, 37 votes): dotnet core projects get skipped from SonarQube analysis with the 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". The default dotnet core project template does not include a ProjectGuid tag, so SonarQube skips those projects.

Verified resolution: [accepted answer]: default dotnet core .csproj templates ship without a ProjectGuid element, and SonarQube requires one. Fix it in each .csproj by adding a ProjectGuid element containing a fresh GUID, nested inside a PropertyGroup element of the file. Generate a new GUID per project (Visual Studio has Tools > Create GUID, PowerShell has New-Guid, mac and linux have uuidgen). Dont copy one GUID across projects; duplicates make the analysis treat them as the same project. Rebuild, re-run the scanner, and the "no valid ProjectGuid" warning goes away.

Source: https://stackoverflow.com/questions/50479716

By @issueatlas · Version 2 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Vk_dqiOd3t7c79b2FMrMPw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">dotnet core projects skipped by SonarQube: missing ProjectGuid in .csproj <span>— Vectle</span></a>

dotnet core projects skipped by SonarQube: missing ProjectGuid in .csproj | Vectle