Skip to content

Commit b7e1037

Browse files
authored
Fix ConfigurationManager when BaseDirectory starts with \\?" (#58627)
1 parent 7d54e21 commit b7e1037

File tree

1 file changed

+1
-11
lines changed
  • src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration

1 file changed

+1
-11
lines changed

src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,7 @@ private ClientConfigPaths(string exePath, bool includeUserConfig)
6464
if (exeAssembly != null && !isSingleFile)
6565
{
6666
HasEntryAssembly = true;
67-
68-
// The original .NET Framework code tried to get the local path without using Uri.
69-
// If we ever find a need to do this again be careful with the logic. "file:///" is
70-
// used for local paths and "file://" for UNCs. Simply removing the prefix will make
71-
// local paths relative on Unix (e.g. "file:///home" will become "home" instead of
72-
// "/home").
73-
string configBasePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, exeAssembly.ManifestModule.Name);
74-
Uri uri = new Uri(configBasePath);
75-
76-
Debug.Assert(uri.IsFile);
77-
ApplicationUri = uri.LocalPath;
67+
ApplicationUri = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, exeAssembly.ManifestModule.Name);
7868
}
7969
else
8070
{

0 commit comments

Comments
 (0)