* 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.
* Create a scoped service provider for the call to Configure
- This allows scoped dependencies to be injected into the Configure method.
It means you can resolve the DbContext or any other scoped service without
the hassle of the CreateScope boiler plate. As a side effect, it also makes
Startup.Configure a bit more testable.
- Keep all the code in the test itself, instead of in an
extension method. Makes it easier to understand what's
happening without having to look up the extension
method's definition.
* 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.