entity-framework - 更新数据库已过时 - Visual Studio 2015 Update 3

标签 entity-framework visual-studio-2015

我已经完成了 Visual Studio 2015 Update 3 的升级,一个项目正在使用 ASP.Net Core,但仅适用于使用 gulp 等的前端 JS 和 CSS。我只是尝试在项目上运行迁移并进行迁移得到以下内容:

Update-Database is obsolete. Use Apply-Migration instead.
Using project 'ProjectName'
Build started...
Build succeeded.
Using start-up project 'MyProject'.
Using application base 'pathlocation'.
Using application configuration 'pathlocation'\Web.config'
Using data directory ''pathlocation'\App_Data'
Using assembly 'My.dll'.
Exception calling "CreateInstanceAndUnwrap" with "8" argument(s): "Could not load file or assembly 'EntityFramework.Commands' or one of its dependencies. The system cannot find the file specified."

我看不到我已经升级到 EF 7,我在项目中卸载并重新安装了 EF 6。关于我遗漏的任何建议?

最佳答案

我确定这与 .Net Core 弄乱了工具有关。为了解决我以管理员身份运行 VS。删除了 .Net Core 项目中 packages.config 中的所有 EF 7 引用。然后通过包管理器控制台卸载并重新安装 EF 6:

Uninstall-Package EntityFramework -Force
Install-Package EntityFramework -Pre

关于entity-framework - 更新数据库已过时 - Visual Studio 2015 Update 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38227132/

相关文章:

c# - 为什么我的 Entity Framework 代码不首先 DbContext 显示我填充的表中的实体?

c# - 实现 Entity Framework 6 添加或更新方法的最简单方法是什么

nuget.config被忽略,特别是repositoryPath

c++ - 在 MSVC 编译器下使用最大成员初始化 union

c++ - 到目前为止,我可以在 Visual Studio 2015 中使用 C++ 模块做什么? (使用实验开关)

c# - Entity Framework 抛出异常 : index was outside the bounds of the array

c# - EF4 在保存更改之前看不到上下文更改

iis-express - 使用 VS2015 和 IIS Express 覆盖站点绑定(bind)

.net - 内部连接以获取不在表中的那些

android - 如何将 Material Design 标准图标导入 Visual Studio Xamarin 项目