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

Unrecognized option '--environment' when using dotnet cli tools #15026

Closed
FunkyLambda opened this issue Mar 14, 2019 · 3 comments
Closed

Unrecognized option '--environment' when using dotnet cli tools #15026

FunkyLambda opened this issue Mar 14, 2019 · 3 comments
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported

Comments

@FunkyLambda
Copy link

FunkyLambda commented Mar 14, 2019

As per the following comment by @bricelam:
#7353 (comment)

I ran this:
dotnet ef database update --startup-project ../<my_project> --environment Development

This gives:
Unrecognized option '--environment'

I'm using:
.NET Command Line Tools (2.1.504)

@FunkyLambda FunkyLambda changed the title Unrecognized option '--environment' when using botnet cli tools Unrecognized option '--environment' when using dotnet cli tools Mar 14, 2019
@bricelam
Copy link
Contributor

bricelam commented Mar 14, 2019

The --environment options was removed in version 2.0. Use this instead:

set ASPNETCORE_ENVIRONMENT=Development
dotnet ef database update --startup-project ../<my_project>

@MarounMaroun
Copy link

MarounMaroun commented Jan 3, 2022

@bricelam Can I read this value from my migration file (i.e. Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"))? Will it be passed as an env variable?

@bricelam
Copy link
Contributor

bricelam commented Jan 4, 2022

@MarounMaroun Yes, that should work.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported
Projects
None yet
Development

No branches or pull requests

4 participants