dotnet / project-system

The .NET Project System for Visual Studio
MIT License
959 stars 386 forks source link

Dependency tree can show yellow triange on group when no triangle exists within group #9360

Closed drewnoakes closed 6 months ago

drewnoakes commented 6 months ago

Use the following project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <CollectUpToDateCheckInputDesignTimeDependsOn>$(CollectUpToDateCheckInputDesignTimeDependsOn);DoesNotExist</CollectUpToDateCheckInputDesignTimeDependsOn>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="METADATAEXTRACTOR" Version="2.4.3" />
  </ItemGroup>

</Project>

NOTE:

Steps:

  1. Open the project in VS. The design-time build will fail as described. The dependencies tree shows yellow triangles everywhere: image
  2. Comment out the CollectUpToDateCheckInputDesignTimeDependsOn property to fix the design time build and save the .csproj file, triggering the project to re-evaluate and re-build.
  3. Note that all yellow triangles disappear everywhere except the Packages and Dependencies nodes. Expanding these will not attribute the warning to any given dependency. image

This seems like a convoluted series of steps, but I've seen this occasionally in our repo. CPS provides the following two packages:

In this repo we reference: