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

Provides extensions method for IServiceCollection similar to WebHostBuilderKestrelExtensions to better support generic host #2498

@chuanboz

Description

@chuanboz

currently there is a WebHostBuilderKestrelExtensions that provides UseKestrel method to inject default implementation of Kestrel.

followed
aspnet/Hosting#1369
and https://github.com/aspnet/Hosting/tree/dev/samples/GenericWebHost

to use general web host, which does not use IWebHostBuilder anymore and so require extensions method to inject default Kestrel implementation.

something like below

`

public static IServiceCollection UseKestrel(this IServiceCollection services)
{
// Don't override an already-configured transport
services.TryAddSingleton<ITransportFactory, SocketTransportFactory>();
services.AddTransient<IConfigureOptions, KestrelServerOptionsSetup>();
services.AddSingleton<IServer, KestrelServer>();
return services;
}

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions