Skip to content

Commit

Permalink
System.Configuration.ConfigurationManager.Tests: use Assembly.Locatio…
Browse files Browse the repository at this point in the history
…n to determine ThisApplicationPath. (#112231)

* System.Configuration.ConfigurationManager.Tests: use Assembly.Location to determine ThisApplicationPath.

* Remove exePath_UserLevelNone test.

This is functionally covered other tests (OpenExeConfiguration2 and OpenExeConfiguration2_ExePath_DoesNotExist)
that do not rely on the test deployment.
  • Loading branch information
tmds authored Feb 10, 2025
1 parent 68a88d1 commit cc74292
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,6 @@ public void OpenExeConfiguration2_ExePath_DoesNotExist()
}
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/21319", TargetFrameworkMonikers.NetFramework)]
public void exePath_UserLevelNone()
{
string name = TestUtil.ThisApplicationPath;
SysConfig config = ConfigurationManager.OpenExeConfiguration(name);
Assert.Equal(TestUtil.ThisApplicationPath + ".config", config.FilePath);
}

[Fact]
public void exePath_UserLevelPerRoaming()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ public static void RunWithTempFiles(MyAction<string, string> action)
}
}

public static string ThisApplicationPath
{
get
{
return Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
Assembly.GetEntryAssembly().ManifestModule.Name);
}
}

public static string ThisConfigFileName
{
get
Expand Down

0 comments on commit cc74292

Please sign in to comment.