.NET Core has considerably evolved since @Stefano’s answer a year ago. In .NET Core 2.0, you can now use the well-known AppDomain.CurrentDomain.ProcessExit
event instead of AssemblyLoadContext.Default.Unloading
. It works fine for console applications on Linux, also in Docker.
More Related Contents:
- What replaces WCF in .Net Core?
- Cross-platform file name handling in .NET Core
- How to compile .NET Core app for Linux on a Windows machine
- How to get HttpContext.Current in ASP.NET Core? [duplicate]
- HTTP Error 500.30 – ANCM In-Process Start Failure
- How do you multi-target a .NET Core class library with csproj?
- Add client certificate to .NET Core HttpClient
- Is ConfigurationManager.AppSettings available in .NET Core 2.0?
- How to load assemblies located in a folder in .NET Core console app
- Asp.Net core long running/background task
- What are the costs and possible side effects of calling BuildServiceProvider() in ConfigureServices()
- Command dotnet ef not found
- Should I take ILogger, ILogger, ILoggerFactory or ILoggerProvider for a library?
- HTTP Error 500.19 when publish .net core project into iis with 0x80070005
- How to unapply a migration in ASP.NET Core with EF Core
- Manipulating images with .NET Core
- Is there a way to make a console application run using only a single file in .NET Core?
- Switch between dotnet core SDK versions
- How to auto create database on first run?
- Get List element position in c# using LINQ
- Why does System.Text Json Serialiser not serialise this generic property but Json.NET does?
- Parallel.ForEach memory usage keeps growing
- ReadKey InvalidOperationException application does not have a console
- Developing C# on Linux [closed]
- How to get user information in DbContext using Net Core
- How should I manage DbContext Lifetime in MVC Core?
- .NET Core equivalent to Thread.Abort
- How to globally set default options for System.Text.Json.JsonSerializer?
- What Nuget packages must be referenced by an ASP.NET Core 6 application parts project
- No service for type ‘Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]’ has been registered