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();