Use the AppContext API as it's reccommended (just best practises)

pull/4081/head v4.0.1132
tidusjar 4 years ago
parent 0c6cd92f59
commit 36af39ebca

@ -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);
}

Loading…
Cancel
Save