Migrations: CLI Tools: Honor ASPNETCORE_ENVIRONMENT
See original GitHub issueFrom @opensrcken on November 2, 2016 7:57
Representative of the script I’m using when I encounter said bug.
SET ASPNETCORE_ENVIRONMENT=Test
dotnet ef database update
env.EnvironmentName
does not not seem to be aware of ASPNETCORE_ENVIRONMENT
when running the second command. Instead, it is always set to Development
.
Copied from original issue: dotnet/core#327
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
ef core doesn't use ASPNETCORE_ENVIRONMENT ...
I use visual studio to update all my environments with a certain migration. It had worked fine using the command below. update-database - ......
Read more >Migrate from ASP.NET Core 2.0 to 2.1
This article covers the basics of migrating an ASP.NET Core 2.0 app to 2.1.
Read more >Setting environment variables for ASP.NET Core apps in a ...
In this post I show how you can pass environment variables to your ASP.NET Core apps deployed in Kubernetes using Helm.
Read more >dotnet/efcore rel/2.0.0-preview1 on GitHub
Migrations : Exception thrown with model containing TPH in certain cases: The entity type should derive from to reflect the hierarchy of the...
Read more >How to work with EF Core migrations in ASP.NET Core
You can work with migrations either from within Visual Studio via the Package Manager Console or by using a command-line tool to run...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m writing $env:ASPNETCORE_ENVIRONMENT = ‘Production’ in Package Manager Console and then running Update-Database but still gives the same warning “No Migrations were applied”. It is still not respecting to my ASPNETCORE_ENVIRONMENT.
It has worked since version 2.0.0-preview1. Note, if you’re using PowerShell, the syntax to set an environment variable is different than command prompt: