NServiceBus icon indicating copy to clipboard operation
NServiceBus copied to clipboard

DefineCriticalErrorAction access to IServiceProvider

Open dnv-kimbell opened this issue 1 year ago • 3 comments

Describe the feature.

We are implementing DefineCriticalErrorAction() to shut down the application. In your documentation there is a mention of IHostApplicationLifetime.Stop, but the challenge is that ICriticalErrorContext doesn't give us access to an IServiceProvider where we can get access to IHostApplicationLifetime.

Our workaround is to have a hosted services that polls a static property where DefineCriticalErrorAction() can set the ICriticalErrorContext. Not pretty.

Additional Context

No response

dnv-kimbell avatar May 24 '24 06:05 dnv-kimbell