Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Microsoft.AspNetCore.App a ref-assembly only package #3608

Closed
natemcmaster opened this issue Oct 11, 2018 · 0 comments
Closed

Make Microsoft.AspNetCore.App a ref-assembly only package #3608

natemcmaster opened this issue Oct 11, 2018 · 0 comments
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Comments

@natemcmaster
Copy link
Contributor

natemcmaster commented Oct 11, 2018

Problem

Currently, projects which reference ASP.NET Core get compilation references from NuGet packages. When using Microsoft.AspNetCore.App 2.1, this results in the compiler referencing 168 .dll files from NuGet packages. These .dll files also happen to be the implementation binaries used in some scenarios. This has some negative consequences, such as (but not limited to):

  • Build perf: A simple netcoreapp2.1 + Microsoft.AspNetCore.App project requires 277 NuGet packages. This has a noticeable impact on all project operations involving NuGet. Even with optimizations like offline restore and NuGet's no-op restore, there is a noticeable amount of time spent on restore. This is visible both on command line "dotnet restore" and in VS UI.
  • Disk space: These 277 packages also bring down hundreds of other files that are never used for a netcoreapp2.1+ project. The SDK and NuGet must filter through all these to provide the actual set of assets required to compile and run an app. This adds time to project commands like build, publish, test, etc.
  • Offline cache: Offline packages caches in Azure Web Apps, Visual Studio, and the .NET Core SDK have become quite large (~1.0 GB) to satisfy offline restore scenarios.
  • Versioning quirks: There is no good answer for how to version each of those hundreds of NuGet packages. There is tension between avoiding re-shipping binaries which haven't changes, and having a sensible, consistent versioning.

Proposed solution

Let's update Microsoft.AspNetCore.App to follow the pattern established by Microsoft.NETCore.App in 2.0.0. This requires 2 breaking changes.

  1. Remove all NuGet package dependencies from Microsoft.AspNetCore.App
  2. Produce reference references for compilation. Microsoft.AspNetCore.App only includes reference assemblies, and does not result in restoring unnecessary packages

Requirements

Microsoft.AspNetCore.App must:

  1. Contain a "runtime.json" file. Required for self-contained deployment (see details in # Produce platform-specific packages for Microsoft.AspNetCore.App #3607)
  2. Place all ref assemblies in ref/netcoreapp3.0/*.dll

FYI prototype: aspnet/AspLabs#25

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

No branches or pull requests

2 participants