From 4d5c93f094a0749f1cf8858fe743c43167a5a966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Ko=C5=BEelj?= Date: Wed, 4 Jan 2023 16:01:49 +0100 Subject: [PATCH] Change reference paths to application base instead of executingassembly --- src/Connected.Host/DependencyLoader.cs | 2 +- src/Connected.Host/Program.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Connected.Host/DependencyLoader.cs b/src/Connected.Host/DependencyLoader.cs index dbf160d..38def3b 100644 --- a/src/Connected.Host/DependencyLoader.cs +++ b/src/Connected.Host/DependencyLoader.cs @@ -84,7 +84,7 @@ public class DependencyLoader /* * Install packages in standard location. */ - var packageDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, ".packages"); + var packageDirectory = Path.Combine(AppContext.BaseDirectory, ".packages"); var nugetSettings = Settings.LoadDefaultSettings(packageDirectory); diff --git a/src/Connected.Host/Program.cs b/src/Connected.Host/Program.cs index d214fdc..149fea1 100644 --- a/src/Connected.Host/Program.cs +++ b/src/Connected.Host/Program.cs @@ -13,7 +13,7 @@ namespace Connected.Host { cfg.AddCommandLine(args); - var appPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + var appPath = AppContext.BaseDirectory; var segments = new Uri(appPath).Segments; segments = segments.Select(e => e.Replace("%20", " ")).ToArray();