In windows container, how to graceful shutdown asp.net core application?

253 views Asked by At

In windows container, how to graceful shutdown asp.net core application?

I want use external process(ex: bash,powershell,dotnet core console application) to update my external module dll(be using by Assembly.Load).
So I need to stop my application to avoid dll file be lock.
I wish stop by graceful shutdown.


My production environment has windows and Linux versions.
In linux,I create a process to execute "bash -c pkill dotnet" to graceful shutdown.
in windows,I don't know how to implement.

  • Try to send SIGTERM but not found way.
  • Try to execute taskkill, show The "process with PID could not be terminated", I think due to no MainWindowHandle(always be 0)
  • Try send ctrl+C to process, but can't attach to the process.
0

There are 0 answers