From 36af39ebca9806edd01b55d0582daa0f93c62828 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Mon, 1 Mar 2021 08:33:08 +0000 Subject: [PATCH] Use the AppContext API as it's reccommended (just best practises) --- src/Ombi/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi/Program.cs b/src/Ombi/Program.cs index 60f287a16..9caa657b5 100644 --- a/src/Ombi/Program.cs +++ b/src/Ombi/Program.cs @@ -251,12 +251,12 @@ namespace Ombi if (setBaseUrl) { var trimmedBaseUrl = baseUrl.EndsWith('/') ? baseUrl.TrimEnd('/') : baseUrl; - var process = Process.GetCurrentProcess().MainModule.FileName; + var process = AppContext.BaseDirectory; var ombiInstalledDir = Path.GetDirectoryName(process); var indexPath = Path.Combine(ombiInstalledDir, "ClientApp", "dist", "index.html"); if (!File.Exists(indexPath)) { - var error = $"Can't set the base URL because we cannot find the file at {indexPath}, if you are trying to set a base url please report this on Github!"; + var error = $"Can't set the base URL because we cannot find the file at '{indexPath}', if you are trying to set a base url please report this on Github!"; Console.WriteLine(error); throw new Exception(error); }