I use visual studio to update all my environments with a specific migration. It worked perfectly using the command below.
update-database -Migration initMigrationProduct -c ProductContext -Environment Production
In ef core 2.0, this command has been changed and the -Environment option removed. in the documents he said.
"With 2.0, you can use the ASPNETCORE_ENVIRONMENT environment variable instead."
https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet
I have tried all kinds of ways now, but when I run update-database with ef core 2.0, it does not use the ASPNETCORE_ENVIRONMENT variable. I tried to set application properties in the registry.
Please let me know what I need to do for this to work with updating different environments?
If I run the application with different lanch settings, it works, but does not use the package manager console.
c # visual-studio-2017 .net-core entity-framework-core
joakimja
source share