.NET Core app service shutting down on Linux

Kevin VH 6 Reputation points
2020-01-31T19:42:01.19+00:00

I'm am experimenting with a .NET Core 2.2 application on a Linux App Service. After awhile I will see the default "Hey .Net Core developers!" screen. When I look through my application logs, I have a bunch of exceptions happening due to issues in my code. I do have "Always On" enabled in the App Service settings. My questions are:

1) Is there some kind of configuration that tells the dotnet process to exit if a certain number of exceptions occur? If so, how can I turn that off?

2) In my startup settings for the App Service, I have my Startup Command as 'dotnet /home/site/wwroot/MyMVCAssembly.dll'. It seems like this command runs when the Docker container starts, which is fine.. but after the container is started, if that dotnet process dies for some reason, there's nothing that restarts it.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,302 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Vahid Ghafarpour 18,445 Reputation points
    2023-08-21T06:18:42.93+00:00

    By default, .NET Core applications don't have a built-in mechanism to exit upon a certain number of exceptions. Exceptions should not cause the application to terminate, except in cases of unhandled exceptions that lead to a crash. It's possible that you might be observing an unexpected behavior specific to your application or environment. Make sure you're properly handling exceptions in your code using try-catch blocks, and logging the exception details. If you're experiencing frequent crashes or unexpected termination, it might be related to the specific issues in your code. Investigating the exception details and fixing those issues is crucial to ensure the stability of your application.

    0 comments No comments