Skip to content

Commit

Permalink
Correct searching config base on exe file name.
Browse files Browse the repository at this point in the history
  • Loading branch information
soroshsabz committed Jul 10, 2022
1 parent 98a36b3 commit ec1cf7c
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ public string Path
get
{
string rootPath = Package.Current.InstalledLocation.Path;
string exeConfig = System.IO.Path.Combine(rootPath, Package.Current.DisplayName + ".exe.config");
if (!File.Exists(exeConfig))
string packageConfig = System.IO.Path.Combine(rootPath, Package.Current.DisplayName + ".exe.config");
string exeConfig = System.IO.Path.Combine(rootPath, System.AppDomain.CurrentDomain.FriendlyName + ".exe.config");
if (File.Exists(packageConfig))
{
return System.IO.Path.Combine(rootPath, "App.config");
return packageConfig;
}
else
else if (File.Exists(exeConfig))
{
return exeConfig;
}
else
{
return System.IO.Path.Combine(rootPath, "App.config");
}
}
}
}
Expand Down

0 comments on commit ec1cf7c

Please sign in to comment.