升级到Visual Studio 16.3.0后,dotnet ef命令不再起作用 [英] dotnet ef command no longer works after upgrading to Visual Studio 16.3.0

查看:248
本文介绍了升级到Visual Studio 16.3.0后,dotnet ef命令不再起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这首先发生在家里,所以我认为这可能是我的台式PC出现问题的原因.但是现在我恢复工作了,我尝试了升级并得到了同样的东西.

This happened at home first, so I thought maybe it was an issue with my desktop PC at home. But now that I am back at work, I tried the upgrade and got the same thing.

升级前的屏幕截图

升级Visual Studio后的屏幕截图

我得到的错误是:

由于找不到指定的命令或文件而无法执行.

Could not execute because the specified command or file was not found.

可能的原因包括:

  • 您拼错了内置的dotnet命令.
  • 您打算执行.NET Core程序,但dotnet-ef不存在.
  • 您打算运行全局工具,但是在PATH上找不到具有该名称的点号前缀的可执行文件.
  • You misspelled a built-in dotnet command.
  • You intended to execute a .NET Core program, but dotnet-ef does not exist.
  • You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

关于为什么会发生这种情况的任何想法?以及如何找回dotnet ef命令.我的意思是以前一定在$PATH中,否则以前就不会起作用.

Any ideas on why this happens? And how do I get back the dotnet ef command. I mean must have been in the $PATH previously, otherwise it wouldn't have worked before.

推荐答案

这是

EF Core命令行工具dotnet ef不再是.NET Core SDK的一部分.

The EF Core command-line tool, dotnet ef, is no longer part of the .NET Core SDK.

...

.NET SDK从3.0开始,不包括dotnet ef工具,因此在使用它之前,必须将其显式安装为本地或全局工具.

Starting in 3.0, the .NET SDK does not include the dotnet ef tool, so before you can use it you have to explicitly install it as a local or global tool.

您需要安装实体框架核心工具.要全局安装,请在命令行上运行它:

You need to install the Entity Framework Core Tools. To install it globally, run this on the command line:

dotnet tool install --global dotnet-ef

这篇关于升级到Visual Studio 16.3.0后,dotnet ef命令不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆