Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent exceptions during LifetimeScope resolution in AutofacProcessorFactory #23

Merged
merged 1 commit into from
Apr 28, 2016

Conversation

smithc
Copy link
Contributor

@smithc smithc commented Apr 28, 2016

If the Dependency Resolver for a given integration (MVC, WebAPI) is configured for the solution, the AutofacProcessorFactory will attempt to resolve child lifetime scopes from those integrations before falling back to the root container. This functionality is necessary in order to support tagged lifetime scope resolution, such as PerRequest.

However, in the above scenario, if an integration's LifetimeScopeProvider (ex. MvcLifetimeScopeProvider) throws during resolution of the inner lifetime scope, this exception will bubble up and break the AutofacProcessorFactory.

This pull request proposes catching all such exceptions from integrated LifetimeScopeProviders, and falling back to the root Container.

@smithc smithc added the bug label Apr 28, 2016
@smithc smithc merged commit 648a831 into dev Apr 28, 2016
@smithc smithc deleted the lifetime-scope-provider-fix branch October 20, 2016 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

1 participant