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

Calling UseKestrel() (no args) then calling Configure<KestrelServerOptions> ends up with null service provider #755

Closed
davidfowl opened this issue Apr 18, 2016 · 0 comments
Assignees
Milestone

Comments

@davidfowl
Copy link
Member

davidfowl commented Apr 18, 2016

The following won't work if UseKestrel doesn't use the Action<KestrelServerOptions> overload. We need to register the default

builder.UseKestrel()
services.Configure<KestrelServerOptions>(o =>
{
    System.Console.WriteLine(o.ApplicationServices == null);
});

This line https://github.com/aspnet/KestrelHttpServer/blob/dev/src/Microsoft.AspNetCore.Server.Kestrel/WebHostBuilderKestrelExtensions.cs#L45 needs to be moved to UseKestrel()

/cc @mikeharder @Tratcher

@mikeharder mikeharder added this to the 1.0.0-rc2 milestone Apr 18, 2016
@mikeharder mikeharder self-assigned this Apr 18, 2016
mikeharder added a commit that referenced this issue Apr 18, 2016
…755)

- Previously, KestrelServerOptionsSetup was only added to IServiceCollection in UseKestrel(options)
- Required to ensure that options.ApplicationServices is available after calling UseKestrel()
mikeharder added a commit that referenced this issue Apr 18, 2016
- Required to ensure that options.ApplicationServices is available after during UseKestrel(options)
mikeharder added a commit that referenced this issue Apr 18, 2016
- Required to ensure that options.ApplicationServices is available after during UseKestrel(options)
mikeharder added a commit to mikeharder/KestrelHttpServer that referenced this issue Apr 29, 2016
…spnet#755)

- Previously, KestrelServerOptionsSetup was only added to IServiceCollection in UseKestrel(options)
- Required to ensure that options.ApplicationServices is available after calling UseKestrel()
mikeharder added a commit to mikeharder/KestrelHttpServer that referenced this issue Apr 29, 2016
aspnet#757)

- Required to ensure that options.ApplicationServices is available after during UseKestrel(options)
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

2 participants