* Add IStartupConfigureServicesFilter to wrap ConfigureServices.
* Add IStartupConfigureContainerFilter<TContainerBuilder> to wrap
ConfigureContainer.
* Make StartupLoader build a thunk for configure services that
resolves all instances of IStartupConfigureServicesFilter and
IStartupConfigureContainerFilter<TContainerBuilder> and wraps
invocations to ConfigureServices and ConfigureContainer respectively.
* Refactor building the ConfigureServices callback into a private
builder class due to the increased complexity in the process.
* Add synchronous Start back to IWebHost
- Fixed extension methods to have a default(CancellationToken)
- Removed extension methods for Start, StartAsync and StopAsync
* Add support for executing IHostingStartup in specified assemblies
- Assemblies that are specified in the "hostingStartupAssemblies" configuration (; delimited)
setting can specify assemblies that use an assembly level attribute (HostingStartupAttribute)
to specify a type that implements IHostingStartup. This allows hosting environments to
extend the IWebHostBuilder with platform specific behavior before the application runs.
- Added tests
- Log errors that occur during load and execution of the IHostingStartup
when capture startup errors is off. This happens on start of the application.
- Added debug logging on startup to print out the hosted startup assemblies hosting
processed
#951
- Renamed the type to IHostedService and added Start and Stop.
- Split up the IHostedService execution and IApplicationLifetime to avoid
circular references
- Trigger IHostedService.Start after starting the server
- Trigger IHostedService.Stop before disposing the service provider
#895#894
- Introduce a new DI friendly API for handling lifetime events. IApplicationLifetime isn't
isn't replaceable so we introduce a new DI friendly API that can be implemented to handle
lifetime events of an ASP.NET application. It should also make it possible to write up extension
on IWebHostBuilder to wire up to external systems that need to register the state of the application (like systemd).
- Run all handlers even if one throws
- Let both sets of event handlers run before throwing (IApplicationLifetimeEvents and IApplicationLifetime cancellation token callbacks).