Skip to content

Resolve package references to projects #1151

@natemcmaster

Description

@natemcmaster

In project.json, dependencies could be either a project or a package reference. NuGet and compilation would resolve the package vs project based on some conventions (like folder name) and the global.json file. Futhermore, VS would automatically add new projects to the solution explorer when the were discovered.

In MSBuild, there is no equivalent feature. References are either ProjectReference or PackageReference. Swapping a package reference to a project is not always straight forward. In cases where the package is a transitive reference from other PackageReferences, you have to keep the PackageReference and set ExcludeAssets=All in order to avoid conflicts between ProjectReference and PackageReference. (See https://docs.microsoft.com/en-us/nuget/schema/msbuild-targets#replacing-one-library-from-a-restore-graph). It also requires manually adding new projects to the sln file so they appear in VS.

It would be nice to provide a way to resolve PackageReference to projects without requiring changes to csproj.


Some data on this:


cc @davidfowl @dsplaisted

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-NetSDKCost:XLmore than 20 weeks of work per central guidance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions