From adeba633e5030e0af6908487c007faa9fe062c78 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Mon, 22 May 2023 18:28:13 -0700 Subject: [PATCH] csproj tweaks to support app publish --- MoonWorks.csproj | 3 ++- src/MoonWorksDllMap.cs | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/MoonWorks.csproj b/MoonWorks.csproj index 2b68c6d..9346bc8 100644 --- a/MoonWorks.csproj +++ b/MoonWorks.csproj @@ -1,7 +1,7 @@ - net7.0 + net7.0 x64 true 11 @@ -22,6 +22,7 @@ PreserveNewest + Never diff --git a/src/MoonWorksDllMap.cs b/src/MoonWorksDllMap.cs index c030adb..9cd0f90 100644 --- a/src/MoonWorksDllMap.cs +++ b/src/MoonWorksDllMap.cs @@ -97,16 +97,12 @@ namespace MoonWorks // Get the path to the assembly Assembly assembly = Assembly.GetExecutingAssembly(); - string assemblyPath = ""; - if (assembly.Location != null) - { - assemblyPath = Path.GetDirectoryName(assembly.Location); - } + string assemblyPath = System.AppContext.BaseDirectory; // Locate the config file string xmlPath = Path.Combine( assemblyPath, - assembly.GetName().Name + ".dll.config" + "MoonWorks.dll.config" ); if (!File.Exists(xmlPath)) {