Graceful shutdown not work in .NetFramework image
I have a Console application with .Net 6 and publish it with self-contained. This application needs graceful shutdown because it would be ran in a container that hosted in Kubernetes.
When I used .Net 6 runtime as base image (mcr.microsoft.com/dotnet/runtime:6.0), it worked well as expect. The ApplicationStopping, StopAsync and ApplicationStopped were triggered and logs displayed.
When I used .Net Framework as based image (mcr.microsoft.com/dotnet/framework/runtime:3.5, this is required for my application because some tools required it), it didn't work. Only ApplicationStopping was triggered and container was shutdown quickly even I set ShutdownTimeout to 60 seconds.
Is there any way to make it working in .Net framework?