Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Core / Kestrel Application is shutting down without reason

An existing setup where .net core (2.2) apis are hosted under IIS 7.5 ran smooth and nice so far.

Suddenly I experienced that the logs hold the message Application is shutting down... without any indicators of errors or other reasons. I started recognizing this when there suddenly were a lot more log files generated than before.

I a not sure but that could have started when I moved from .NET Core 2.1 to 2.2.

Does anyone know if this is a feature or a bug, harmfull or intended?

like image 974
monty Avatar asked Mar 06 '19 14:03

monty


2 Answers

I was getting exactly the same message on my development environment. Even dotnet run wouldn't work. Editing the ~/Properties/launchSettings.json file and selecting a higher port fixed it. (I switched from port 1306 to port 30931).
I still haven't been able to figure out what is suddenly blocking port 1306.

like image 109
Mike Olund Avatar answered Nov 16 '22 03:11

Mike Olund


I had the same issue building a .Net Core 3.1 Worker Service. The issue for me was that my Execute method wasn't actually using the await operator.

I fixed the issue by changing a line of logging to this:

 await Task.Run(() => _logger.LogInformation("Starting Service"));
like image 28
todji Avatar answered Nov 16 '22 02:11

todji