Skip to content

Move all MSBuild logic from Microsoft.AspNetCore.App (the package) into an MSBuild SDK #3611

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

Closed
natemcmaster opened this issue Oct 11, 2018 · 8 comments
Assignees
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework Done This issue has been fixed

Comments

@natemcmaster
Copy link
Contributor

Problem

Follow-up to #3608. In 2.1 and 2.2, there are some MSBuild targets and tooling bundled in the NuGet packages pulled in by Microsoft.AspNetCore.App. As a part of making Microsoft.AspNetCore.App a shared framework in 2.1, we failed to realize that this would impact MSBuild targets and related tooling. The design of shared frameworks calls for the package version of Microsoft.AspNetCore.App to be pinned and not to update in packages. This makes it difficult to service the MSBuild targets and tooling without also impacting compilation references and runtime versions.

In 3.0, this will impacts the following

  • Microsoft.AspNetCore.App
  • Microsoft.AspNetCore.Razor.Design
  • Microsoft.AspNetCore.Mvc.Razor.Extensions
  • Microsoft.Extensions.Configuration.UserSecrets
  • Microsoft.Extensions.FileProviders.Embedded

Proposed solution

All packages that are part of Microsoft.AspNetCore.App should move MSBuild targets and tasks out of the package and into an MSBuild SDK.

  • Targets and tools for Razor compilation move into Microsoft.NET.Sdk.Razor.
  • Targets for Microsoft.AspNetCore.App move into Microsoft.NET.Sdk (the <FrameworkReference> feature)
  • Targets and tasks for Microsoft.Extensions.FileProviders.Embedded move into either:
    • An in-box SDK like Microsoft.NET.Sdk
    • A separate package named something like Microsoft.Extensions.FileProviders.Embedded.Sdk which provides build-time only assets
  • Targets for Microsoft.Extensions.Configuration.UserSecrets move into Microsoft.NET.Sdk
@natemcmaster natemcmaster added the feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform label Oct 11, 2018
@natemcmaster natemcmaster added this to the 3.0.0 milestone Oct 11, 2018
@poke
Copy link
Contributor

poke commented Oct 11, 2018

So in order to use Razor features, projects will have to set their SDK to Microsoft.NET.Sdk.Razor? How will that impact projects that would want to use a different SDK? I expect Microsoft.NET.Sdk.Web to extend the Razor SDK? But what happens when there are multiple disjunctive SDKs involved in the future?

@natemcmaster
Copy link
Contributor Author

Users shouldn’t need to change the SDK used in projects. Microsoft.NET.Sdk.Razor already exists in the 2.1 tooling, but it’s not typically referenced in project file.

@poke
Copy link
Contributor

poke commented Oct 11, 2018

Okay, so it is possible for a project to reference multiple SDKs. Alright, nevermind my comment then :)

@rynowak
Copy link
Member

rynowak commented Oct 11, 2018

So in order to use Razor features, projects will have to set their SDK to Microsoft.NET.Sdk.Razor?

Yeah this is already the case 😆 - historically Razor only worked in web applications. We added class library support in 2.1 but it's always required Razor SDK.

@dsplaisted
Copy link
Member

Just to be clear, you don't (and won't) need to explicitly use the Razor SDK if your project uses Microsoft.NET.Sdk.Web.

@muratg
Copy link
Contributor

muratg commented Jan 30, 2019

Moving out since preview2 is done. @natemcmaster I assume this is still required?

@natemcmaster
Copy link
Contributor Author

The work is blocked, pending a design from the SDK team on how targeting packs should specify package conflict resolution metadata.

@muratg muratg added the blocked The work on this issue is blocked due to some dependency label Jan 30, 2019
@muratg muratg modified the milestones: 3.0.0-preview3, 3.0.0 Jan 30, 2019
@Eilon Eilon modified the milestones: 3.0.0, 3.0.0-preview5 Apr 5, 2019
@natemcmaster natemcmaster self-assigned this Apr 17, 2019
@natemcmaster natemcmaster removed the blocked The work on this issue is blocked due to some dependency label Apr 17, 2019
@natemcmaster
Copy link
Contributor Author

This work was completed in 3.0 preview 4.

  • Conflict resolution data is shipped in targeting packs as .txt files which the SDK supports
  • Mvc and Razor targets and tasks ship in the Web SDK.
  • User secrets support was added to Microsoft.NET.Sdk
  • Those who want to use the embedded file provider can opt-in to the manifest generation by adding a PackageReference to Microsoft.Extensions.FileProviders.Embedded. Until there is sufficient demand, there are no plans to move the manifest generation targets into the SDK itself.

@natemcmaster natemcmaster added the Done This issue has been fixed label Apr 17, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
@JunTaoLuo JunTaoLuo added area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework and removed feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform labels Jan 28, 2021
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 Done This issue has been fixed
Projects
None yet
Development

No branches or pull requests

7 participants