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-staging] Set the environment when executing Scaffold-DBContext #35693

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

AndriySvyryd
Copy link
Member

Fixes #35641

Description

In EF 9.0.0 we made a change to set the environment variables ASPNETCORE_ENVIRONMENT and DOTNET_ENVIRONMENT to Development when using IDesignTimeDbContextFactory. But since the code was moved this had an unintended side effect of no longer setting the environment variables during Scaffold-DBContext as it does not use IDesignTimeDbContextFactory.

Customer impact

Code that relied on a specific environment is broken. A workaround is to set the environment variables manually.

How found

Multiple customer reports on 9.0.1

Regression

Yes, from 9.0.0, introduced in #35230

Testing

Tests added.

Risk

Low. Design-time only

@AndriySvyryd AndriySvyryd merged commit fb2f189 into release/9.0-staging Feb 27, 2025
7 checks passed
@AndriySvyryd AndriySvyryd deleted the Issue35641 branch February 27, 2025 16:26
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