From 5a8ae5b4c2c65e351748d81e1a82443a3313e151 Mon Sep 17 00:00:00 2001 From: BtbN Date: Thu, 13 Jun 2019 18:47:03 +0200 Subject: [PATCH] Change Program class to follow required pattern --- ClanServer/Program.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ClanServer/Program.cs b/ClanServer/Program.cs index 170b725..4163428 100644 --- a/ClanServer/Program.cs +++ b/ClanServer/Program.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -13,17 +13,21 @@ namespace ClanServer { public class Program { - public static void Main() + public static void Main(string[] args) { - var builder = new WebHostBuilder() + var builder = CreateWebHostBuilder(args); + var host = builder.Build(); + + host.Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] _) + { + return new WebHostBuilder() .UseContentRoot(AppContext.BaseDirectory) .UseStartup() .UseKestrel() .ConfigureKestrel(ConfigureKestrel); - - var host = builder.Build(); - - host.Run(); } private static void ConfigureKestrel(WebHostBuilderContext context, KestrelServerOptions options)