Skip to content

Replace PackageReference to Microsoft.AspNetCore.App with FrameworkReference #3612

@natemcmaster

Description

@natemcmaster

Problem

Most NuGet packages provide both compilation and runtime assets. Microsoft.NETCore.App and Microsoft.AspNetCore.App effectively only provide the first - compilation references. Users must install other runtime assets to make .NET Core apps work but this is not obvious or intuitive, and not always possible: for example, Azure Web Apps, AWS, Google Cloud, etc. This violates a reasonable expectation of using a NuGet package, and has been a continual source of confusion for users.

See #3307 for more context.

Proposed solution

Change the item type used to reference the shared framework in a .csproj file.

<ItemGroup>
   <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Unlike PackageReference, a FrameworkReference item:

  • May not actually be a NuGet package. (It might be -- but that's an implementation detail hidden from users.)
  • There is no Version attribute
  • The version of the FrameworkReference is controlled by TargetFramework.

Open questions:

  • How does a user specify the runtime patch version? TFMs only include major.minor
  • How is FrameworkReference preserved when putting a class library in a NuGet package?
  • Are FrameworkReference items transitive across ProjectReference?

Requirements

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-infrastructureIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared frameworkbreaking-changeThis issue / pr will introduce a breaking change, when resolved / merged.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions