gpt4 book ai didi

entity-framework - EF7 : The term 'add-migration' is not recognized as the name of a cmdlet

转载 作者:行者123 更新时间:2023-12-03 12:02:40 27 4
gpt4 key购买 nike

我将框架版本设置为:project.json 中的 dnx46。
还有以下包:

  "dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.Core": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final"
}

但是,当我开始运行 enable-migrations 命令时,我得到以下信息:

术语“启用迁移”未被识别为 cmdlet 的名称

有谁知道我如何在最新的 .NET 中运行 EF 迁移?

最佳答案

这对我来说是解决这个问题的方法:

跑:

Install-Package Microsoft.EntityFrameworkCore.Tools –Pre

在 project.json 中将此(如果还没有)添加到“工具”部分:
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview4-final",

有用的引用: https://docs.efproject.net/en/latest/platforms/aspnetcore/new-db.html

关于entity-framework - EF7 : The term 'add-migration' is not recognized as the name of a cmdlet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35140341/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com