<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.1" />

ConfigPathUtility

static class ConfigPathUtility
namespace System.Configuration { internal static class ConfigPathUtility { private const char SeparatorChar = '/'; internal static bool IsValid(string configPath) { if (string.IsNullOrEmpty(configPath)) return false; int num = -1; for (int i = 0; i <= configPath.Length; i++) { switch ((i < configPath.Length) ? configPath[i] : '/') { case '\\': return false; case '/': if (i == num + 1) return false; if (i == num + 2 && configPath[num + 1] == '.') return false; if (i == num + 3 && configPath[num + 1] == '.' && configPath[num + 2] == '.') return false; num = i; break; } } return true; } internal static string Combine(string parentConfigPath, string childConfigPath) { if (string.IsNullOrEmpty(parentConfigPath)) return childConfigPath; if (string.IsNullOrEmpty(childConfigPath)) return parentConfigPath; return parentConfigPath + "/" + childConfigPath; } internal static string[] GetParts(string configPath) { return configPath.Split('/', StringSplitOptions.None); } internal static string GetName(string configPath) { if (string.IsNullOrEmpty(configPath)) return configPath; int num = configPath.LastIndexOf('/'); if (num == -1) return configPath; return configPath.Substring(num + 1); } } }