|
|
@@ -1,4 +1,5 @@ |
|
|
|
using System.IO; |
|
|
|
using Microsoft.AspNetCore; |
|
|
|
using Microsoft.AspNetCore.Builder; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
@@ -7,22 +8,30 @@ namespace Sample.RabbitMQ.SqlServer |
|
|
|
{ |
|
|
|
public class Program |
|
|
|
{ |
|
|
|
|
|
|
|
//var config = new ConfigurationBuilder() |
|
|
|
// .AddCommandLine(args) |
|
|
|
// .AddEnvironmentVariables("ASPNETCORE_") |
|
|
|
// .Build(); |
|
|
|
|
|
|
|
//var host = new WebHostBuilder() |
|
|
|
// .UseConfiguration(config) |
|
|
|
// .UseKestrel() |
|
|
|
// .UseContentRoot(Directory.GetCurrentDirectory()) |
|
|
|
// .UseIISIntegration() |
|
|
|
// .UseStartup<Startup>() |
|
|
|
// .Build(); |
|
|
|
|
|
|
|
//host.Run(); |
|
|
|
public static void Main(string[] args) |
|
|
|
{ |
|
|
|
var config = new ConfigurationBuilder() |
|
|
|
.AddCommandLine(args) |
|
|
|
.AddEnvironmentVariables("ASPNETCORE_") |
|
|
|
.Build(); |
|
|
|
BuildWebHost(args).Run(); |
|
|
|
} |
|
|
|
|
|
|
|
var host = new WebHostBuilder() |
|
|
|
.UseConfiguration(config) |
|
|
|
.UseKestrel() |
|
|
|
.UseContentRoot(Directory.GetCurrentDirectory()) |
|
|
|
.UseIISIntegration() |
|
|
|
public static IWebHost BuildWebHost(string[] args) => |
|
|
|
WebHost.CreateDefaultBuilder(args) |
|
|
|
.UseStartup<Startup>() |
|
|
|
.Build(); |
|
|
|
|
|
|
|
host.Run(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |