Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Commit

Permalink
Set the app domain variable so that AppContext.BaseDirectory works
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfowl committed Sep 9, 2015
1 parent 772fe9e commit c9adfd8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Microsoft.Dnx.Host/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public Task<int> RunAsync(List<string> args, IRuntimeEnvironment env, FrameworkN
{
applicationBaseDirectory = Directory.GetCurrentDirectory();
}

// Set the app domain variable so that AppContext.BaseDirectory works on .NET Framework (and hopefully mono)
AppDomain.CurrentDomain.SetData("APP_CONTEXT_BASE_DIRECTORY", applicationBaseDirectory);
#else
string applicationBaseDirectory = AppContext.BaseDirectory;
#endif
Expand Down

0 comments on commit c9adfd8

Please sign in to comment.