Fix order of raising AssemblyLoadContext.Unloading and AppDomain.ProcessExit (dotnet...
authorCaio Kinelski <t-cakine@microsoft.com>
Wed, 28 Dec 2016 16:11:05 +0000 (08:11 -0800)
committerKoundinya Veluri <kouvel@microsoft.com>
Wed, 28 Dec 2016 16:11:05 +0000 (08:11 -0800)
commite4f8f59cbd3ecb536b40d378d7eb7292d9cacb08
tree35c122fc1ee9e3ad3928246145a6e294c68b7ff0
parent88f195e0e335696fb94292d7276369300f88dcd2
Fix order of raising AssemblyLoadContext.Unloading and AppDomain.ProcessExit (dotnet/coreclr#8737)

The AssemblyLoadContext.Unloading event must be raised before the AppDomain.ProcessExit event.
AssemblyLoadContext.OnUnloading now subscribes to AppContext.Unloading.
Then AppContext.OnAppContextUnloading and AppContext.OnProcessExit, in that order, subscribe to AppDomain.ProcessExit.
Part of fix for dotnet/corefxdotnet/coreclr#14566

Commit migrated from https://github.com/dotnet/coreclr/commit/d178b1287377a837773defb6b2a7f2b4e2dfc667
src/coreclr/src/mscorlib/src/System/AppContext/AppContext.cs
src/coreclr/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs