diff --git a/Application/SystemConfiguration.cs b/Application/SystemConfiguration.cs index a16b6fd..48f345e 100644 --- a/Application/SystemConfiguration.cs +++ b/Application/SystemConfiguration.cs @@ -1,7 +1,6 @@ using FeedCenter.Properties; using System; using System.IO; -using System.Reflection; namespace FeedCenter; @@ -9,7 +8,7 @@ public static class SystemConfiguration { private static bool UseDebugPath => Environment.CommandLine.IndexOf("/debugPath", StringComparison.InvariantCultureIgnoreCase) != -1; - public static string DataDirectory => UseDebugPath ? Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) : UserSettingsPath; + public static string DataDirectory => UseDebugPath ? Path.GetDirectoryName(AppContext.BaseDirectory) : UserSettingsPath; public static string UserSettingsPath { @@ -17,7 +16,7 @@ public static class SystemConfiguration { // If we're running in debug mode then use a local path for the database and logs if (UseDebugPath) - return Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); + return Path.GetDirectoryName(AppContext.BaseDirectory); // Get the path to the local application data directory var path = Path.Combine( diff --git a/appveyor.yml b/appveyor.yml index f96a15f..53340ed 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ assembly_info: assembly_version: "{version}" assembly_file_version: "{version}" before_build: - - ps: dotnet restore .\Application\ + - ps: nuget restore - ps: dotnet publish .\Application\ /p:PublishProfile=Properties\PublishProfiles\x64.pubxml build: project: Installer\Installer.sln