diff --git a/GC-local-server-rewrite/Program.cs b/GC-local-server-rewrite/Program.cs index 17b5e02..ed3fae3 100644 --- a/GC-local-server-rewrite/Program.cs +++ b/GC-local-server-rewrite/Program.cs @@ -87,13 +87,19 @@ internal class Program private static void LogConfigValues() { - var log = $"Config values: {nameof(Configs.SE_COUNT)} : {Configs.SE_COUNT}\n" + + var configs = $"Config values: {nameof(Configs.SE_COUNT)} : {Configs.SE_COUNT}\n" + $"{nameof(Configs.ITEM_COUNT)} : {Configs.ITEM_COUNT}\n" + $"{nameof(Configs.SKIN_COUNT)} : {Configs.SKIN_COUNT}\n" + $"{nameof(Configs.TITLE_COUNT)} : {Configs.TITLE_COUNT}\n" + $"{nameof(Configs.AVATAR_COUNT)} : {Configs.AVATAR_COUNT}\n" + $"{nameof(Configs.NAVIGATOR_COUNT)} : {Configs.NAVIGATOR_COUNT}\n" + $"{nameof(Configs.MUSIC_DB_NAME)} : {Configs.MUSIC_DB_NAME}\n"; - log.Info(); + configs.Info(); + + var paths = $"Paths: {nameof(PathHelper.HtmlRootPath)}: {PathHelper.HtmlRootPath}\n" + + $"{nameof(PathHelper.LogRootPath)}: {PathHelper.LogRootPath}\n" + + $"{nameof(PathHelper.DataBaseRootPath)}: {PathHelper.DataBaseRootPath}\n"; + paths.Info(); + } } \ No newline at end of file diff --git a/GC-local-server-rewrite/common/PathHelper.cs b/GC-local-server-rewrite/common/PathHelper.cs index 39b9624..b9f9399 100644 --- a/GC-local-server-rewrite/common/PathHelper.cs +++ b/GC-local-server-rewrite/common/PathHelper.cs @@ -1,5 +1,4 @@ using System.Diagnostics; -using Swan; namespace GCLocalServerRewrite.common; @@ -21,24 +20,18 @@ public static class PathHelper { get { - var assemblyPath = Path.GetDirectoryName(typeof(Program).Assembly.Location); + var assemblyPath = AppContext.BaseDirectory; #if DEBUG + - Debug.Assert(assemblyPath != null, $"{nameof(assemblyPath)} != null"); - - var parentFullName = Directory.GetParent(assemblyPath)?.Parent?.Parent?.FullName; + var parentFullName = Directory.GetParent(assemblyPath)?.Parent?.Parent?.Parent?.FullName; Debug.Assert(parentFullName != null, $"{nameof(parentFullName)} != null"); return parentFullName; #else - if (assemblyPath != null) - { - return assemblyPath; - } - - throw SelfCheck.Failure("Cannot get assembly path!"); + return AppContext.BaseDirectory; #endif } }