Fix order of raising AssemblyLoadContext.Unloading and AppDomain.ProcessExit (#8737)
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)
commitd178b1287377a837773defb6b2a7f2b4e2dfc667
treec8fb01e2f776a36964a263f1103d4d36c4fdeb5b
parent96400a730d7d4385c17f0930803ad79bd20edeb0
Fix order of raising AssemblyLoadContext.Unloading and AppDomain.ProcessExit (#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/corefx#14566
src/mscorlib/src/System/AppContext/AppContext.cs
src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs