From d9ed7774856b04280cdcb206de1e3e4aef9c2c33 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 7 Oct 2019 10:28:26 +0800 Subject: [PATCH] Remove CurrentDirectoryHelpers. Resolve #1807 --- .../InProcess/CurrentDirectoryHelpers.cs | 63 ------------------- .../app/Volo.BloggingTestApp/Program.cs | 3 - .../Volo.ClientSimulation.Demo/Program.cs | 3 - modules/docs/app/VoloDocs.Web/Program.cs | 3 - .../Acme.BookStore.HttpApi.Host/Program.cs | 3 - .../src/Acme.BookStore.Web/Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - .../src/Acme.BookStore.Web/Program.cs | 3 - .../src/DashboardDemo.Web/Program.cs | 3 - .../applications/AuthServer.Host/Program.cs | 3 - .../BackendAdminApp.Host/Program.cs | 3 - .../PublicWebSite.Host/Program.cs | 3 - .../BackendAdminAppGateway.Host/Program.cs | 3 - .../gateways/InternalGateway.Host/Program.cs | 3 - .../PublicWebSiteGateway.Host/Program.cs | 3 - .../BloggingService.Host/Program.cs | 3 - .../IdentityService.Host/Program.cs | 3 - .../ProductService.Host/Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - .../Program.cs | 3 - 30 files changed, 150 deletions(-) delete mode 100644 framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/InProcess/CurrentDirectoryHelpers.cs diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/InProcess/CurrentDirectoryHelpers.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/InProcess/CurrentDirectoryHelpers.cs deleted file mode 100644 index 80e608a315..0000000000 --- a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/InProcess/CurrentDirectoryHelpers.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; - -namespace Microsoft.AspNetCore.InProcess -{ - /// - /// https://github.com/aspnet/AspNetCore.Docs/blob/master/aspnetcore/host-and-deploy/aspnet-core-module/samples_snapshot/2.x/CurrentDirectoryHelpers.cs - /// TODO: Remove CurrentDirectoryHelpers.cs when upgrade to ASP.NET Core 3.0. - /// - public class CurrentDirectoryHelpers - { - internal const string AspNetCoreModuleDll = "aspnetcorev2_inprocess.dll"; - - [System.Runtime.InteropServices.DllImport("kernel32.dll")] - private static extern IntPtr GetModuleHandle(string lpModuleName); - - [System.Runtime.InteropServices.DllImport(AspNetCoreModuleDll)] - private static extern int http_get_application_properties(ref IISConfigurationData iiConfigData); - - [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)] - private struct IISConfigurationData - { - public IntPtr pNativeApplication; - [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)] - public string pwzFullApplicationPath; - [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)] - public string pwzVirtualApplicationPath; - public bool fWindowsAuthEnabled; - public bool fBasicAuthEnabled; - public bool fAnonymousAuthEnable; - } - - public static void SetCurrentDirectory() - { - try - { - // Check if physical path was provided by ANCM - var sitePhysicalPath = Environment.GetEnvironmentVariable("ASPNETCORE_IIS_PHYSICAL_PATH"); - if (string.IsNullOrEmpty(sitePhysicalPath)) - { - // Skip if not running ANCM InProcess - if (GetModuleHandle(AspNetCoreModuleDll) == IntPtr.Zero) - { - return; - } - - IISConfigurationData configurationData = default(IISConfigurationData); - if (http_get_application_properties(ref configurationData) != 0) - { - return; - } - - sitePhysicalPath = configurationData.pwzFullApplicationPath; - } - - Environment.CurrentDirectory = sitePhysicalPath; - } - catch - { - // ignore - } - } - } -} diff --git a/modules/blogging/app/Volo.BloggingTestApp/Program.cs b/modules/blogging/app/Volo.BloggingTestApp/Program.cs index 66cca7ab18..b184a68b4e 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/Program.cs +++ b/modules/blogging/app/Volo.BloggingTestApp/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace Volo.BloggingTestApp { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() //TODO: Should be configurable! .MinimumLevel.Override("Microsoft", LogEventLevel.Information) diff --git a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Program.cs b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Program.cs index 478db71b8e..86dc8569c7 100644 --- a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Program.cs +++ b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace Volo.ClientSimulation.Demo { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .MinimumLevel.Override("Microsoft", LogEventLevel.Information) diff --git a/modules/docs/app/VoloDocs.Web/Program.cs b/modules/docs/app/VoloDocs.Web/Program.cs index 6dd673f797..26959f112f 100644 --- a/modules/docs/app/VoloDocs.Web/Program.cs +++ b/modules/docs/app/VoloDocs.Web/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace VoloDocs.Web { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() //TODO: Should be configurable! .MinimumLevel.Override("Microsoft", LogEventLevel.Information) diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Program.cs b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Program.cs index 37e301f0b6..5d04ef8371 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Program.cs +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace Acme.BookStore { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Program.cs b/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Program.cs index 818ae148c8..7660775b6c 100644 --- a/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Program.cs +++ b/samples/BookStore-Modular/application/src/Acme.BookStore.Web/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace Acme.BookStore.Web { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Program.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Program.cs index b27b30c4de..ca8ff952ca 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Program.cs +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace Acme.BookStore.BookManagement { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Program.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Program.cs index b27b30c4de..ca8ff952ca 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Program.cs +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace Acme.BookStore.BookManagement { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Program.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Program.cs index b27b30c4de..ca8ff952ca 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Program.cs +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace Acme.BookStore.BookManagement { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Program.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Program.cs index 5c1d10a707..b59c3d6fd8 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Program.cs +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace Acme.BookStore.BookManagement { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .MinimumLevel.Override("Microsoft", LogEventLevel.Information) diff --git a/samples/BookStore/src/Acme.BookStore.Web/Program.cs b/samples/BookStore/src/Acme.BookStore.Web/Program.cs index a1080543cc..6eadd00f78 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Program.cs +++ b/samples/BookStore/src/Acme.BookStore.Web/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace Acme.BookStore.Web { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/samples/DashboardDemo/src/DashboardDemo.Web/Program.cs b/samples/DashboardDemo/src/DashboardDemo.Web/Program.cs index dab3385b07..354ec3f60a 100644 --- a/samples/DashboardDemo/src/DashboardDemo.Web/Program.cs +++ b/samples/DashboardDemo/src/DashboardDemo.Web/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace DashboardDemo.Web { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/Program.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/Program.cs index cdd15af3c0..34e6b74443 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/Program.cs +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Microsoft.Extensions.Configuration; using Serilog; using Serilog.Events; @@ -13,8 +12,6 @@ namespace AuthServer.Host { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - //TODO: Temporary: it's not good to read appsettings.json here just to configure logging var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) diff --git a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/Program.cs b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/Program.cs index e07b19c922..2b1cfb9230 100644 --- a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/Program.cs +++ b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Microsoft.Extensions.Configuration; using Serilog; using Serilog.Events; @@ -13,8 +12,6 @@ namespace BackendAdminApp.Host { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - //TODO: Temporary: it's not good to read appsettings.json here just to configure logging var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/Program.cs b/samples/MicroserviceDemo/applications/PublicWebSite.Host/Program.cs index 291b2247ce..fab8c9f2b3 100644 --- a/samples/MicroserviceDemo/applications/PublicWebSite.Host/Program.cs +++ b/samples/MicroserviceDemo/applications/PublicWebSite.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Microsoft.Extensions.Configuration; using Serilog; using Serilog.Events; @@ -13,8 +12,6 @@ namespace PublicWebSite.Host { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - //TODO: Temporary: it's not good to read appsettings.json here just to configure logging var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) diff --git a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/Program.cs b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/Program.cs index ef2062a7e0..95ddd89b2c 100644 --- a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/Program.cs +++ b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Microsoft.Extensions.Configuration; using Serilog; using Serilog.Events; @@ -13,8 +12,6 @@ namespace BackendAdminAppGateway.Host { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - //TODO: Temporary: it's not good to read appsettings.json here just to configure logging var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) diff --git a/samples/MicroserviceDemo/gateways/InternalGateway.Host/Program.cs b/samples/MicroserviceDemo/gateways/InternalGateway.Host/Program.cs index 5a2c568f3f..8cd13725ad 100644 --- a/samples/MicroserviceDemo/gateways/InternalGateway.Host/Program.cs +++ b/samples/MicroserviceDemo/gateways/InternalGateway.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Microsoft.Extensions.Configuration; using Serilog; using Serilog.Events; @@ -13,8 +12,6 @@ namespace InternalGateway.Host { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - //TODO: Temporary: it's not good to read appsettings.json here just to configure logging var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) diff --git a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/Program.cs b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/Program.cs index c17e6c27fc..23d419b91d 100644 --- a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/Program.cs +++ b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Microsoft.Extensions.Configuration; using Serilog; using Serilog.Events; @@ -13,8 +12,6 @@ namespace PublicWebSiteGateway.Host { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - //TODO: Temporary: it's not good to read appsettings.json here just to configure logging var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) diff --git a/samples/MicroserviceDemo/microservices/BloggingService.Host/Program.cs b/samples/MicroserviceDemo/microservices/BloggingService.Host/Program.cs index 2cac132029..61bcf82104 100644 --- a/samples/MicroserviceDemo/microservices/BloggingService.Host/Program.cs +++ b/samples/MicroserviceDemo/microservices/BloggingService.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Microsoft.Extensions.Configuration; using Serilog; using Serilog.Events; @@ -13,8 +12,6 @@ namespace BloggingService.Host { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - //TODO: Temporary: it's not good to read appsettings.json here just to configure logging var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) diff --git a/samples/MicroserviceDemo/microservices/IdentityService.Host/Program.cs b/samples/MicroserviceDemo/microservices/IdentityService.Host/Program.cs index 3379404ed1..44fb949f87 100644 --- a/samples/MicroserviceDemo/microservices/IdentityService.Host/Program.cs +++ b/samples/MicroserviceDemo/microservices/IdentityService.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Microsoft.Extensions.Configuration; using Serilog; using Serilog.Events; @@ -13,8 +12,6 @@ namespace IdentityService.Host { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - //TODO: Temporary: it's not good to read appsettings.json here just to configure logging var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) diff --git a/samples/MicroserviceDemo/microservices/ProductService.Host/Program.cs b/samples/MicroserviceDemo/microservices/ProductService.Host/Program.cs index 44787ecf83..3b9cfb6630 100644 --- a/samples/MicroserviceDemo/microservices/ProductService.Host/Program.cs +++ b/samples/MicroserviceDemo/microservices/ProductService.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Microsoft.Extensions.Configuration; using Serilog; using Serilog.Events; @@ -13,8 +12,6 @@ namespace ProductService.Host { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - //TODO: Temporary: it's not good to read appsettings.json here just to configure logging var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs index 498ac83351..c4a5b7a007 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace MyCompanyName.MyProjectName { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs index 498ac83351..c4a5b7a007 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace MyCompanyName.MyProjectName { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs index 51278be6eb..31b888e68d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace MyCompanyName.MyProjectName { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs index 2bd7916ecc..0fdbda7bf9 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace MyCompanyName.MyProjectName.Web { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs index 2e9d5cb202..47b0ced597 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace MyCompanyName.MyProjectName.Web { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs index 6043a28f6b..639e485a38 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace MyCompanyName.MyProjectName { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs index 6043a28f6b..639e485a38 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace MyCompanyName.MyProjectName { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs index 6043a28f6b..639e485a38 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace MyCompanyName.MyProjectName { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() #if DEBUG .MinimumLevel.Debug() diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs index bcd4742424..c1e595c693 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.InProcess; using Serilog; using Serilog.Events; @@ -11,8 +10,6 @@ namespace MyCompanyName.MyProjectName { public static int Main(string[] args) { - CurrentDirectoryHelpers.SetCurrentDirectory(); - Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .MinimumLevel.Override("Microsoft", LogEventLevel.Information)