简体   繁体   English

ASP.NET 中的迁移核心代码首先不起作用

[英]Migrations in ASP.NET Core code-first not working

I used to be able to do migrations using this command我曾经能够使用此命令进行迁移

dotnet ef migrations add seedData  -p Persistence/ -s API/

But now I get an error:但现在我得到一个错误:

在此处输入图像描述

I have looked online and I tried updating the dotnet-ef tool:我在网上查看并尝试更新dotnet-ef工具:

dotnet tool update --global dotnet-ef

Successfully updated
Tool 'dotnet-ef' was successfully updated from version '3.1.3' to version '3.1.6'.

I reference these packages in my project:我在我的项目中引用了这些包:

Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore.Tools

Can anyone suggest to me why my migrations are working anymore.任何人都可以向我建议为什么我的迁移工作了。 Thanks谢谢

I had to update my sdk runtime for the migrations to work.我必须更新我的 sdk 运行时才能进行迁移。

https://dotnet.microsoft.com/download/dotnet-core/3.1 https://dotnet.microsoft.com/download/dotnet-core/3.1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM