我已经完成了 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/