在尝试使用'dnx时获取'MissingMethodException'.ef migration'添加'在EF7 beta6中

Sha*_*ehr 6 c# asp.net entity-framework entity-framework-core

我正在尝试在Visual Studio 2015 RTM中使用ASP.NET 5 beta5和Entity Framework 7 beta6.问题是,即使完全按照这样的指南,我也无法让它们一起运行:http: //ef.readthedocs.org/en/latest/getting-started/aspnet5.html

在这个例子中,当我到达我需要运行此命令的部分时:

dnx . ef migration add MyFirstMigration
Run Code Online (Sandbox Code Playgroud)

我总是得到这个错误:

Using context 'BloggingContext'.
System.MissingMethodException: Method not found: 'Boolean Microsoft.Framework.DependencyInjection.ServiceCollectionExtensions.TryAdd(Microsoft.Framework.DependencyInjection.IServiceCollection, Microsoft.Framework.DependencyInjection.ServiceDescriptor)'.
Run Code Online (Sandbox Code Playgroud)

我尝试并重试了所有步骤,并在没有运气的情况下搜索了我可能在项目中遗漏的任何内容.

Phi*_*ler 0

此问题可能是因为您使用的 Dot Net 虚拟机版本不正确(或只是有错误)。尝试运行dnvm list看看您已经安装了哪些版本以及哪个版本设置为活动状态,然后您可能需要运行dnvm use ...来切换版本。

例如,我运行dnvm use 1.0.0-rc1-update1许多 .csproj 应用程序。