Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Hosting API followup #530

Closed
Closed
@JunTaoLuo

Description

@JunTaoLuo

Continuing discussion on items left over from #525

  1. Configuration
    Currently we use recommend using builder.UseConfiguration(WebApplicationConfiguration.GetDefault(args)). This is verbose. One suggestion for this is to add a UseConfiguration(string[] args) overload for only command line configs. Also, there is some contention on whether environment variables and hosting.json configurations should be enabled by default.
  2. WebApplication void Start() vs IDisposable Start()
    There are two suggestions for WebApplication.Start(). We currently use the IDisposable pattern which lends itself to a convenient pattern using(app.Start()){ ... } where we handle shutdown through Dispose(). However, since we do not support an application being started more than once, it is natural to return void. This leads to less desirable usage patterns however, such as using(var app = builder.Build()){app.Start(); ... }.
  3. WebApplicationBuilder.Run()/.Start()
    Currently we build an application using a builder, configure that application (such as setting addresses), then run or start the application. There is a suggestion on making address configuration more first class on the WebApplicationBuilder and directly calling Start() or Run() on the builder but this will require shuffling of startup since Addresses are currently ServerFeatures that are only available after the WebApplication is built. It's also suggested to possibly add overloads to Start() and Run() to take in a list of addresses to listen on.
  4. Exception messages
    Some of the current exception messages need to be updated. For example, the message at StartupLoader.cs#L46 can be cryptic. For this exception in particular, it should be determined if it's the responsibility of the WebApplication or the StartupLoader, which could be third party, to throw exception to the user.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions