aspnet / Hosting

[Archived] Code for hosting and starting up an ASP.NET Core application. Project moved to https://github.com/aspnet/Extensions and https://github.com/aspnet/AspNetCore
Apache License 2.0
552 stars 312 forks source link

Allow hosting startup failures to be detected somehow #1579

Closed hiteshmadan closed 5 years ago

hiteshmadan commented 5 years ago

I'm injecting an assembly with the right attribute, and a class with the IHostStartup, and things work fine. However in cases where the injected dll isn't placed correctly, i want to have a hook that lets me detect any hosting startup failures and conditionally crash my process (so its obvious that assembled package is faulty / won't behave as expected)

Options:

(i'm looking at the release/2.1 branch)

Tratcher commented 5 years ago

Duplicate of https://github.com/aspnet/Hosting/issues/1151.

This has already been fixed for generic host (Start just throws). I doubt we'll make the breaking change required to web host, but for 3.0 we're rebuilding web host on top of generic host so it would inherit this change.