diff --git a/WebInterface/Startup.cs b/WebInterface/Startup.cs index 480dbf9..4da1898 100644 --- a/WebInterface/Startup.cs +++ b/WebInterface/Startup.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.IO; +using System.Reflection; using System.Runtime.InteropServices; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -24,8 +25,9 @@ namespace WebInterface string supervisor = "Supervisor"; if (isWindows) supervisor += ".exe"; - if (!File.Exists(supervisor)) - throw new Exception($"Couldn't find {supervisor} in {Directory.GetCurrentDirectory()}"); + string supervisorPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), supervisor); + if (!File.Exists(supervisorPath)) + throw new Exception($"Couldn't find {supervisor} at {supervisorPath}"); Process.Start(supervisor); }