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

Hosting and TestServer API update #131

Open
JunTaoLuo opened this issue Dec 21, 2015 · 0 comments
Open

Hosting and TestServer API update #131

JunTaoLuo opened this issue Dec 21, 2015 · 0 comments

Comments

@JunTaoLuo
Copy link

In aspnet/Hosting#521 we are making some updates to the Hosting and TestServer API. Main changes include:

  1. Single entry point
    Previously we had multiple entry points for web applications including in Hosting (Microsoft.AspNet.Hosting), Servers (e.g. Microsoft.AspNet.Server.Kestrel) and the the application itself (e.g. Startup.cs). We have removed the entry points in Hosting and the servers so the only entry point moving forward is from the application. This will required updates to the project.json including setting emitEntryPoint to true under compilationOptions and setting commands to point to the Startup assembly. Configuration for server selection and address configuration can be achieved through hosting.json. As an example, refer to aspnet/Diagnostics@c476f91 for updates required after this change.
  2. Renames
    -WebHostBuilder has been renamed to WebApplicationBuilder and will now build an IWebapplication.
    -WebHostOptions has been renamed to WebApplicationOptions
    -IApplication and IHostingEngine have been merged to become IWebApplication as have the classes that implement them. Note that Start() will no longer return an IApplication but will still return an IDisposable for handling shutdown.
    -The old WebApplication has split into WebApplicationConfiguration from where the default Hosting configurations can be created and WebApplicationExtensions which contains the extension method for running IWebApplications
  3. TestServer
    TestServer will no longer have overloaded methods for Create. All configurations should be done using a WebApplicationBuilder which is passed to the constructor of TestServer.
  4. Startup assembly name
    Previously, when no startup is specified, we default to using the current assembly when nothing is specified. This has been removed so now an explicit Startup must be specified through WebApplication.Configure(...), WebApplication.UseStartup(...) or through hosting.json.
  5. Namespace updates
    ApplicationLifetime, HostingEnvironment and HostingEnvironmentExtensions have moved to the Micrsoft.AspNet.Hosting.Internal namespace.

Samples of the usage of the new API can be found in https://github.com/aspnet/Hosting/tree/dev/samples/SampleStartups

Please use aspnet/Hosting#525 for discussion.

@JunTaoLuo JunTaoLuo added this to the 1.0.0-rc2 milestone Dec 21, 2015
@aspnet aspnet locked and limited conversation to collaborators Dec 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant