我在 EF 迁移方面遇到问题,特别是让“Enable-Migrations”命令发挥作用。当我在包管理器控制台中执行命令时,收到以下错误:
System.Management.Automation.PSArgumentException:找不到类型 System.Data.Entity.Migrations.MigrationsCommands]:确保加载包含此类型的程序集。
在 System.Management.Automation.MshCommandRuntime.ThrowTerminateError(ErrorRecord errorRecord)
找不到类型 [System.Data.Entity.Migrations.MigrationsCommands]:确保加载包含此类型的程序集。
在我看来,NuGet 控制台无法从我的 EF 程序集中找到 MigrationsCommands 类型。我已经检查过,该程序集是最新的程序集(4.3.1),并且在对象浏览器中我无法找到 MigrationsCommands 类型或命名空间。
UPDATE:我仍然没有解决方案,但当我在包管理器控制台中运行“Install-Package EntityFramework”命令时,问题的根源似乎在以下输出中。错误在这里:
Unable to find type [ConnectionFactoryConfiguratorInvoker]: make sure that the assembly containing this type is loaded.
At C:\...\packages\EntityFramework.4.3.1\tools\install.ps1:36 char:39
+ [ConnectionFactoryConfiguratorInvoker] <<<< ::Invoke((Join-Path $toolsPath "EntityFramework.PowerShell.dll"), $project)
+ CategoryInfo : InvalidOperation: (ConnectionFactoryConfiguratorInvoker:String) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
经过几个小时的搜索,我找到了解决方案。他们的钥匙位于Here http://haacked.com/archive/2010/10/05/introducing-nupack-package-manager.aspx#79307Phil Haack 对“Chris”关于 Reflector 6.5 的回应。我安装了 Reflector(奇怪的是 7.0 版)并在 VS2010 中启用了 Reflector Add-On。经过研究NuGet 常见问题解答 http://docs.nuget.org/docs/start-here/nuget-faq我卸载了 Reflector 并禁用了 VS2010 插件。这似乎已经解决了问题,因为我现在可以毫无问题地“Install-Package EntityFramework”和“Enable-Migrations”。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)