运行 dotnet ef 命令时无法识别选项“-Context”

Jho*_*rra 1 c# entity-framework-core .net-core dotnet-cli

启动一个新项目,并尝试设置数据库进行身份验证。我在 powershell 中运行以下命令。 dotnet ef database update -Context ApplicationDbContext 并得到以下错误Unrecognized option '-Context'

所以我尝试在不使用 -Context 选项的情况下运行它,只是为了查看和获取:

More than one DbContext was found. Specify which one to use. Use the '-Context' parameter 
for PowerShell commands and the '--context' parameter for dotnet commands.
Run Code Online (Sandbox Code Playgroud)

我还尝试使用 --context 而不是 -context 运行它,但得到相同的错误。关于为什么它认识到我需要该选项,但同时又告诉我它不认识该选项,有什么建议吗?

我还重新启动了powershell。

And*_*ewE 6

而不是使用--context ApplicationDbContext你尝试过-c ApplicationDbContext https://learn.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet#aspnet-core-environment