6 changed files with 24 additions and 42 deletions
@ -1,28 +1,16 @@ |
|||||
using Microsoft.AspNetCore.Hosting; |
using Microsoft.AspNetCore; |
||||
using Microsoft.Extensions.Configuration; |
using Microsoft.AspNetCore.Hosting; |
||||
using Microsoft.Extensions.Logging; |
|
||||
|
|
||||
namespace Mvc.Client |
namespace Mvc.Client |
||||
{ |
{ |
||||
public static class Program |
public static class Program |
||||
{ |
{ |
||||
public static void Main(string[] args) |
public static void Main(string[] args) => |
||||
{ |
BuildWebHost(args).Run(); |
||||
var configuration = new ConfigurationBuilder() |
|
||||
.AddEnvironmentVariables() |
|
||||
.AddCommandLine(args) |
|
||||
.Build(); |
|
||||
|
|
||||
var host = new WebHostBuilder() |
public static IWebHost BuildWebHost(string[] args) => |
||||
.ConfigureLogging(options => options.AddConsole()) |
WebHost.CreateDefaultBuilder(args) |
||||
.ConfigureLogging(options => options.AddDebug()) |
|
||||
.UseConfiguration(configuration) |
|
||||
.UseIISIntegration() |
|
||||
.UseKestrel() |
|
||||
.UseStartup<Startup>() |
.UseStartup<Startup>() |
||||
.Build(); |
.Build(); |
||||
|
|
||||
host.Run(); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,28 +1,16 @@ |
|||||
using Microsoft.AspNetCore.Hosting; |
using Microsoft.AspNetCore; |
||||
using Microsoft.Extensions.Configuration; |
using Microsoft.AspNetCore.Hosting; |
||||
using Microsoft.Extensions.Logging; |
|
||||
|
|
||||
namespace Mvc.Server |
namespace Mvc.Server |
||||
{ |
{ |
||||
public static class Program |
public static class Program |
||||
{ |
{ |
||||
public static void Main(string[] args) |
public static void Main(string[] args) => |
||||
{ |
BuildWebHost(args).Run(); |
||||
var configuration = new ConfigurationBuilder() |
|
||||
.AddEnvironmentVariables() |
|
||||
.AddCommandLine(args) |
|
||||
.Build(); |
|
||||
|
|
||||
var host = new WebHostBuilder() |
public static IWebHost BuildWebHost(string[] args) => |
||||
.ConfigureLogging(options => options.AddConsole()) |
WebHost.CreateDefaultBuilder(args) |
||||
.ConfigureLogging(options => options.AddDebug()) |
|
||||
.UseConfiguration(configuration) |
|
||||
.UseIISIntegration() |
|
||||
.UseKestrel() |
|
||||
.UseStartup<Startup>() |
.UseStartup<Startup>() |
||||
.Build(); |
.Build(); |
||||
|
|
||||
host.Run(); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue