Skip to content

Commit

Permalink
Use AppContext.BaseDirectory
Browse files Browse the repository at this point in the history
instead of Assembly.GetExecutingAssembly().Location.

Related #992
  • Loading branch information
kant2002 committed Apr 15, 2022
1 parent 0df367b commit b679996
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public CustomConfig()
// BenchmarkDotNet will rebuild the project with a project reference to this project when this project's output exe is ran. It
// will be ran from the same folder as where we have the application manifest binplaced which we want to embed in the new exe.
string manifestFile = Path.Combine(
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
AppContext.BaseDirectory,
"Benchmarks.manifest");

var winmdJob = Job.Default
Expand Down
2 changes: 1 addition & 1 deletion src/cswinrt/strings/WinRT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ internal unsafe sealed class DllModule
readonly delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> _GetActivationFactory;
readonly delegate* unmanaged[Stdcall]<int> _CanUnloadNow; // TODO: Eventually periodically call

static readonly string _currentModuleDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
static readonly string _currentModuleDirectory = AppContext.BaseDirectory;

static Dictionary<string, DllModule> _cache = new System.Collections.Generic.Dictionary<string, DllModule>(StringComparer.Ordinal);

Expand Down

0 comments on commit b679996

Please sign in to comment.