Improve serveradmin.xml error logging - show all attempted paths

This commit is contained in:
Claude
2025-11-24 07:22:47 +00:00
parent c4b8e4395c
commit 7d4b95f342

View File

@@ -170,6 +170,8 @@ public static class AdminManager
private static string FindServerAdminXml()
{
List<string> attemptedPaths = new List<string>();
try
{
// Try common locations
@@ -185,19 +187,32 @@ public static class AdminManager
try
{
string fullPath = Path.GetFullPath(path);
attemptedPaths.Add(fullPath);
if (File.Exists(fullPath))
{
Console.WriteLine($"[AdminManager] Found serveradmin.xml: {fullPath}");
return fullPath;
}
}
catch { }
catch (Exception e)
{
attemptedPaths.Add($"{path} (Error: {e.Message})");
}
}
}
catch (Exception e)
{
Console.WriteLine($"[AdminManager] Error finding serveradmin.xml: {e.Message}");
}
// Log all attempted paths
Console.WriteLine("[AdminManager] serveradmin.xml not found. Attempted paths:");
foreach (var path in attemptedPaths)
{
Console.WriteLine($" - {path}");
}
return null;
}