Merged
Conversation
GarrettBeatty
commented
Jan 12, 2026
| { | ||
| "Projects": [ | ||
| { | ||
| "Name": "Amazon.Lambda.AspNetCoreServer", |
Contributor
Author
There was a problem hiding this comment.
autover wasnt working so i added both of these. also why do we need both hosting and server in the changefile? i saw that was done for another PR that touched this class
boblodgett
approved these changes
Jan 12, 2026
normj
approved these changes
Jan 12, 2026
philasmar
approved these changes
Jan 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available: #2236
Issue
When using
AddAWSLambdaBeforeSnapshotRequestwith authentication middleware (or any middleware using scoped services), SnapStart warmup requests fail withInvalidOperationException: Cannot resolve scoped service 'IAuthenticationHandlerProvider' from root provider. This only occurs whenASPNETCORE_ENVIRONMENT=Development.Root Cause
The
AddRegisterBeforeSnapshotmethod inAbstractAspNetCoreFunction.cswas settingRequestServicesdirectly to the rootIServiceProviderinstead of creating a service scope. In Development mode, ASP.NET Core validates that scoped services aren't resolved from the root provider and throws an exception.Fix
Create a service scope before processing each warmup request, matching the behavior of the normal request handler (
FunctionHandlerAsync):Testing
Deployed lambda with snapstart before bug fix and confirmed error
deployed same lambda with bug fix and confirmed no error
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.