实体框架迁移 NuGet 错误

本文关键字:错误 NuGet 迁移 框架 实体 | 更新日期: 2023-09-27 18:31:11

Using Visual Studio 2013 Express Preview for Web and Entity Framework 5

尝试启用迁移时出现以下错误:

PM> Enable-Migrations System.IO.FileNotFoundException: 无法加载 文件或程序集 'Microsoft.VisualStudio.Shell, 版本=10.0.0.0, Culture=中性,PublicKeyToken=b03f5f7f11d50a3a' 或其之一 依赖。系统找不到指定的文件。文件名: 'Microsoft.VisualStudio.Shell, version=10.0.0.0, culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes(Project 项目)在 System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebSiteProject(Project 项目)在 System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetTargetDir(Project 项目)在 System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String 配置类型名称)在 System.Data.Entity.Migrations.EnableMigrationsCommand.FindContextToEnable(String 上下文类型名称) 在 System.Data.Entity.Migrations.EnableMigrationsCommand.<>c_DisplayClass2.<.ctor>b_0() 在 System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action 命令)

无法加载文件或程序集 'Microsoft.VisualStudio.Shell, 版本=10.0.0.0,区域性=中性,公钥令牌=b03f5f7f11d50a3a' 或 它的依赖项之一。系统找不到指定的文件。 下午>

有什么建议吗?

实体框架迁移 NuGet 错误

我遇到了同样的问题,最终通过安装"Microsoft Visual Studio 2012 Shell Redistributable Package (isolated)"(http://www.microsoft.com/en-us/download/details.aspx?id=30670)解决了它。

我尝试了前面提到的可再发行组件包,但它没有修复错误。只需通过 NuGet 包管理器更新实体框架即可为我解决问题。

这里也解释了这个问题: https://connect.microsoft.com/VisualStudio/feedback/details/805933/filenotfoundexception-enabling-ef-migration

它说它已通过vs2013更新2修复。但我刚刚用 Windows 8.1 和更新 2 对其进行了测试,但仍然可以重现这一点。