Skip to content

Represent FrameworkReferences in NuGet - pack & restore support #7342

@dsplaisted

Description

@dsplaisted

Link to specs:

Original issue description
Project files in .NET Core 3.0 will be able to use FrameworkReferences to declare a dependency on optional shared frameworks such as ASP.NET or WPF/WinForms. Currently, a FrameworkReference is expressed like this in a project file:

  <ItemGroup>
    <FrameworkReference Include="Microsoft.DesktopUI"/>
  </ItemGroup>

If a project references a NuGet package or another project that depends on an optional shared framework, then that shared framework dependency should flow from the referenced package or project to the app. This means that FrameworkReferences need to be represented in some way in a NuGet package. We have discussed using the existing frameworkAssembly element for this.

The behavior needed in NuGet would be:

  • During the Pack operation, translate the project's FrameworkReference items into the format that they are expressed in the .nuspec (probably frameworkAssembly)
  • During restore, write FrameworkReference dependencies from referenced packages to the assets file. If frameworkAssembly is used to express these dependencies, then this may happen with little or no code changes
  • During restore, write FrameworkReference information from referenced projects to the assets file. This enables framework references to flow across (possibly transitive) project references

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions