-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Regression Fix - Update HostFactoryResolver, set the app name via an argument #60053
Conversation
Tagging subscribers to this area: @eerhardt, @maryamariyan Issue DetailsBased on original PR: dotnet/efcore#26198 Updates HostFactoryResolver to account for lack of application name with new host pattern and adds test.
|
Thanks @maryamariyan. This will also need to go into 6.0 GA after approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I assume someone has verified this fixes the end-to-end scenario pointed out in the bug.
@eerhardt See Tactics template above for testing plan. |
@ajcvickers - Perfect! Thanks. |
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1317363901 |
Based on original PR: dotnet/efcore#26198
Dupe of PR: #59743
Fixes reported issue: #59745
Updates HostFactoryResolver to account for lack of application name with new host pattern and adds test.
Description
Changes to the templates for 6.0 required a new mechanism for tools to discover and use registered services in an ASP.NET Core or any other app based on a hosted service provider. This new mechanism results in a host setup that does not by default have an application name available. This in turn results in user secrets not being found, and so any tooling that is using user secrets will fail. This was discovered using EF Core which supports obtaining the database connection string from user secrets.
The fix is to set a default application name based on the assembly when using this new mechanism to discover services.
Customer impact
EF Core database operations executed from the command line may fail, or worse, use the wrong connection string and update the wrong database.
How found
Customer reported on RC1.
Regression
Yes and no. It's a regression to the experience when the new templates or the patterns shipped in those templates are used. It is not technically a regression if the application is still using the patterns from previous versions.
Testing
Testing is tricky here because this runtime package is consumed as source in EF Core. This is what we have done and plan to do:
Risk
Low. Simple code change to add a default application name on in the new code path introduced in 6.0.