Skip to content

[Bug]: Sln-based graph builds don't support the special targets with project names #9952

Description

@dfederm

Issue Description

By default if you do somethign like msbuild PowerToysSetup.sln -t:PowerToysInstaller, where the project is named "PowerToysInstaller" in the sln, it will build that one project (and its dependencies) with the default targets, but also with the sln configuration.

If you add -graph as well though, you get errors like Error MSB4057: The target "PowerToysInstaller" does not exist in the project..

The graph behavior should match the non-graph behavior.

Steps to Reproduce

dotnet new classlib -o Project1
dotnet new classlib -o Project2
dotnet new sln
dotnet sln add Project1
dotnet sln add Project2

# Passes
msbuild /t:Project1

# Fails
msbuild /t:Project1 /graph

Expected Behavior

See description

Actual Behavior

See description

Analysis

No response

Versions & Configurations

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions