From e24b488457a7716e36e561fccd5843e33c79aaed Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Tue, 29 Mar 2022 12:29:59 -0700 Subject: [PATCH] ... --- APC Viewer/Program.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/APC Viewer/Program.cs b/APC Viewer/Program.cs index 88b1ac1..09b0667 100644 --- a/APC Viewer/Program.cs +++ b/APC Viewer/Program.cs @@ -17,8 +17,11 @@ public class Program string? assemblyName = assembly.GetName()?.Name; if (string.IsNullOrEmpty(assemblyName)) throw new Exception(); - WebApplicationBuilder webApplicationBuilder = WebApplication.CreateBuilder(args); - _ = webApplicationBuilder.Host.UseWindowsService(); + WebApplicationBuilder webApplicationBuilder = WebApplication.CreateBuilder(new WebApplicationOptions() + { + Args = args, + ContentRootPath = Path.GetDirectoryName(assembly.Location) + }); AppSettings appSettings = Models.Stateless.AppSettings.Get(webApplicationBuilder.Configuration); if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName)) throw new Exception("Working directory name must have a value!");