Skip to content

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
This was referenced Jul 22, 2025
This was referenced Aug 27, 2025
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