在进行Scaffold-DbContext时,发生
The Entity Framework tools version '5.0.3' is older than that of the runtime '5.0.5'. Update the tools for the latest features and bug fixes.
的错误报错。
解决方案:
正如错误消息指出的,我们只需要简单地升级 EF 工具。
运行CMD(必要时用管理员权限运行)以下命令行以更新它:
dotnet tool update --global dotnet-ef
执行结果:
可使用以下命令调用工具: dotnet-ef 已成功安装工具“dotnet-ef”(版本“5.0.5”)。
修复验证:
dotnet-ef
运行以上命令,会出现以下提示:
_/\__
---==/ \\
___ ___ |. \|\
| __|| __| | ) \\\
| _| | _| \_/ | //|\\
|___||_| / \\\/\\
Entity Framework Core .NET Command-line Tools 5.0.5
Usage: dotnet ef [options] [command]
Options:
--version Show version information
-h|--help Show help information
-v|--verbose Show verbose output.
--no-color Don't colorize output.
--prefix-output Prefix output with level.
Commands:
database Commands to manage the database.
dbcontext Commands to manage DbContext types.
migrations Commands to manage migrations.
Use "dotnet ef [command] --help" for more information about a command.
至此问题解决