相关疑难解决方法(0)

术语"更新 - 数据库"未被识别为cmdlet的名称

我正在使用EF5 beta1,而我之前能够运行"更新数据库".现在我关闭了Visual Studio,我无法让它运行.我收到以下错误:

术语"更新 - 数据库"未被识别为cmdlet,函数,脚本文件或可操作程序的名称.检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试.在行:1 char:16 + Update-Database <<<< -verbose + CategoryInfo:ObjectNotFound:(Update-Database:String)[],CommandNotFoundException + FullyQualifiedErrorId:CommandNotFoundException

我试图重新安装EF5b1并且虽然成功(已安装),但"更新数据库"仍然无效.

谁能帮忙???

entity-framework ef-code-first ef-migrations entity-framework-5

104
推荐指数
9
解决办法
8万
查看次数

在Mono中启用实体框架迁移

我已经开始使用Xamarin Studio在Mac OS上构建ASP.NET MVC3项目.我现在想要为项目添加新的属性和模型,但我不能在我的生活中解决如何运行Nuget Package Manager控制台以运行Enable-Migrations命令.

我问得太多了吗?这是可能的还是我必须回到Windows上的Visual Studio?

mono xamarin entity-framework-6

11
推荐指数
1
解决办法
4442
查看次数

如何在asp.net 5项目中启用迁移(EF6)?

我创建了一个新的类库(包)项目(在VS 2015 RC之前使用了更糟糕的asp.net类库名称来表示数据层.只是要清楚这是更新的kproj样式结构.

将EF 6.1.3添加到project.json.目前仅针对DNX451.

   "dependencies": {
        "EntityFramework": "6.1.3"
        ,"Moq": "4.2.1502.911"
    },
Run Code Online (Sandbox Code Playgroud)

创建初始模型类并使用AlwaysCreate数据库初始化程序一切正常.现在需要切换到迁移,以便在包管理器控制台中使用Enable-Migrations并获得:

Enable-Migrations : The term 'Enable-Migrations' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Enable-Migrations
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Enable-Migrations:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Run Code Online (Sandbox Code Playgroud)

对于EF7迁移,迁移命令不支持包管理器.相反,有一个新的ef命令在dnu中运行,但是新进程只适用于EF7而不是EF6吗?

为什么包管理器认为即使引用了EF6,Enable-Migrations仍然无效?

entity-framework-6 asp.net-core

11
推荐指数
1
解决办法
3910
查看次数