* 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
* Enable configuring the default service provider
- Added UseDefaultServiceProvider method
- Made DelegateStartup use the IServiceProviderFactory. One downside
here is that we can't use 3rd party DI containers with the Configure
delegate since it's hardcoded to the the specific Startup type but that's
not a regression.
- 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).
- Startup.ConfigureContainer allows users to configure a 3rd party DI
container in a first class way in the Startup class. 3rd party containers
plug in via IServiceProviderFactory<TContainerBuilder> configured in
IWebHostBuilder.ConfigureServices.
- Added tests