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

[release/9.0] Tools: Fallback to service provider when no context types found #34759

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

AndriySvyryd
Copy link
Member

@AndriySvyryd AndriySvyryd commented Sep 26, 2024

Fixes #34758

Description
In 9 we introduced a circuit-breaker for discovering context types: if all the discovered context types have a corresponding IDesignTimeDbContextFactory implementation, then EF won't use the service provider to get the configuration. However, due to incorrect logic this path was also used when no context types were discovered and the user didn't specify the context type name.

Customer impact
Running dotnet ef migrations add on a typical application that uses migrations project fails. This is a common scenario.
A workaround is to specify the context type with --context

How found
Reported on 9 RC1 by partner team (Aspire).

Regression
Yes, introduced in 5f0887d

Testing
Tests added.

Risk
Low.

@AndriySvyryd AndriySvyryd requested a review from a team September 26, 2024 03:59
@AndriySvyryd AndriySvyryd merged commit 0bf4e1c into release/9.0 Sep 26, 2024
7 checks passed
@AndriySvyryd AndriySvyryd deleted the Issue34758 branch September 26, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants