Browse Source

asp.net core InProcess hosting SetCurrentDirectory.

pull/1402/head
maliming 7 years ago
parent
commit
b179564799
  1. 5
      samples/BookStore/src/Acme.BookStore.Web/Program.cs

5
samples/BookStore/src/Acme.BookStore.Web/Program.cs

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.InProcess;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
@ -10,6 +11,8 @@ namespace Acme.BookStore.Web
{ {
public static int Main(string[] args) public static int Main(string[] args)
{ {
CurrentDirectoryHelpers.SetCurrentDirectory();
Log.Logger = new LoggerConfiguration() Log.Logger = new LoggerConfiguration()
#if DEBUG #if DEBUG
.MinimumLevel.Debug() .MinimumLevel.Debug()
@ -42,8 +45,8 @@ namespace Acme.BookStore.Web
new WebHostBuilder() new WebHostBuilder()
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseIIS() .UseIIS()
.UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()
.UseSerilog() .UseSerilog()
.Build(); .Build();

Loading…
Cancel
Save