During debugging of asp.net core program or after running dotnet command in production environment, an error is reported: Microsoft. Hosting. Lifetime [0] application is shutting down
My reason is that several big brothers wrote several background tasks and inherited the backgroundservice. The code used in the executeasync method is executed synchronously.
In other words, the program must wait for all customized backgroundservices to be executed.
Now that the reason is found, wrap all the code in task.Run() in the executeasync method body.
Similar Posts:
- GulpThe following tasks did not complete [How to Solve]
- MAC terminal (shell) Error: You have mail [How to Solve]
- Lock wait timeout exceeded; try restarting transaction-Mysql [How to Solve]
- the user operation is waiting for “Building workspace” to complete
- Visual Studio Failed to Start Error: throw error ‘cannot run when setup is in progress’
- zsh: exec format error [How to Solve]
- The use of try… Catch in MATLAB
- The whole program exits when [QT] qmessagebox is closed
- The Difference between $(document).ready, window.onload and $(window).load(function (){})
- An error is reported when sqoop imports data into MySQL database: error tool. Exporttool: error during export: export job failed!