Hosting icon indicating copy to clipboard operation
Hosting copied to clipboard

Option to not handle exceptions thrown during bootstrapping (Startup.cs)

Open kcraft opened this issue 10 years ago • 2 comments

I am running my .NET app inside of a containerized environment where I don't have control over the order that my app's dependencies start up (databases and such). I intentionally want my container to fail to start if my app cannot connect to its dependencies during startup. The container runtime will take care of retrying until it works. However, ASP.NET seems to absorb any exceptions that are thrown during startup and reports that it started up successfully anyway. From looking at the code, it seems that "captureStartupErrors" is hardcoded to "true". I would like an option to disable this behavior.

kcraft avatar Jan 06 '16 18:01 kcraft

@JunTaoLuo changed this in RC2, it's now a configuration option. It's currently disabled by default but we plan to turn it back on. https://github.com/aspnet/Hosting/issues/552

Tratcher avatar Jan 06 '16 18:01 Tratcher

Ah, great. Thank you! I'll go ahead and close this, then.

kcraft avatar Jan 06 '16 19:01 kcraft