public static void Main(string[] args)
        {
            var host = HostingAbstractionsWebHostBuilderExtensions.UseContentRoot(WebHostBuilderKestrelExtensions.UseKestrel(new WebHostBuilder()), Directory.GetCurrentDirectory())
                       .UseIISIntegration()
                       .UseStartup <Startup>()
                       .Build();

            WebHostExtensions.Run(host);
        }
        public static TCaller UseKestrel <TCaller>(
            this TCaller @this,
            Action <KestrelServerOptions> configAction = null)
            where TCaller : IConfigurableObject <IServiceHostAspNetCoreListenerReplicaTemplateConfigurator>
        {
            @this.ConfigureObject(
                configurator =>
            {
                configurator.UseCommunicationListener(
                    (
                        context,
                        endpoint,
                        factory) =>
                {
                    return(new KestrelCommunicationListener(context, endpoint, factory));
                },
                    webHostBuilder =>
                {
                    WebHostBuilderKestrelExtensions.UseKestrel(webHostBuilder, options => configAction?.Invoke(options));
                });
            });

            return(@this);
        }
Example #3
0
 private static void DefaultWebHostCommunicationListenerConfigAction(
     IWebHostBuilder builder)
 {
     WebHostBuilderKestrelExtensions.UseKestrel(builder);
 }