Skip to content

Attribute TargetFramework errors to the offending project #12470

Open
@rainersigwald

Description

@rainersigwald

NuGet Product(s) Involved

MSBuild.exe, dotnet.exe

The Elevator Pitch

It's possible to get an error like this:

C:\Program Files\dotnet\sdk\7.0.100\NuGet.targets(132,5): error : Invalid framework identifier ''. [S:\play\missingtf_restore\Referencing\Referencing.csproj]

when the invalid framework identifier is in fact coming from another project, here S:\play\missingtf_restore\Referenced\Referenced.csproj.

It'd be nice if this error had

  1. A unique error code, and
  2. Attribution to the offending project.

Like

S:\play\missingtf_restore\Referenced\Referenced.csproj: error NU1234: Invalid framework identifier ''. [S:\play\missingtf_restore\Referencing\Referencing.csproj]

Additional Context and Details

Small repro: missing_tf_in_ref.zip. Restore from Referencing.

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