Skip to content

Sort out design time interaction with Startup in ASP.NET Core #4546

Closed

Description

@rowanmiller

Our tooling currently runs code in Startup.cs to get the context from services. This is messy though because our design time environment is not the same as the environment the app really runs in. We need to revisit this.

As part of this we need to try and remove ASP.NET specific dependencies from our general commands package so you don't get references to Microsoft.AspNetCore.Hosting.* etc in a UWP/WinForms/WPF project (see #4830).

Related issues:

Activity

  1. added this to the 1.0.0 milestone on Feb 12, 2016
  2. natemcmaster commented on Apr 12, 2016

    @natemcmaster
    Contributor

    See also #5037. In this change, we specifically workaround limitations in UWP and startupinvoker. We will need a different abstraction when/if we stop cross-compiling to UWP. #5045

    This workaround was removed in #5142

  3. natemcmaster commented on Apr 19, 2016

    @natemcmaster
    Contributor

    We will likely need to react to this: aspnet/Hosting#714
    cc @divega

  4. natemcmaster commented on May 9, 2016

    @natemcmaster
    Contributor

    Related issue: #5304 (comment)

    Recent Hosting templates have changed to loading configuration in Program.Main. EF can't (and shouldn't) call Program.Main at design-time, yet we still need to load configuration to get connection strings.

  5. bricelam commented on Jun 1, 2016

    @bricelam
    Contributor

    @ajcvickers, @anpete, @rowanmiller & I discussed this today. We came up with a solution (similar to the one @divega proposed in #2357) that would keep some of the ASP.NET-specific code outside of the main tooling package, but decided that the cost and complexity of implementing it wasn't worth the marginal value it would add.

    As part of #5334, we are going to author and structure the packages in a way that reduces the amount of dependencies that get pulled into your project and utilize NuGet & CLI features to prevent the ones we do pull in from getting deployed with your application.

    I'm closing this issue and splitting off the remaining work into #4710, #5616, #5615, #5617 & #5677

  6. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions