简体   繁体   English

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

[英]Getting 'MissingMethodException' when trying to use 'dnx . ef migration add' in EF7 beta6

I'm trying to play around with ASP.NET 5 beta5 and Entity Framework 7 beta6 in Visual Studio 2015 RTM. 我正在尝试在Visual Studio 2015 RTM中使用ASP.NET 5 beta5和Entity Framework 7 beta6。 The problem is I cannot get them to run together even by exactly following guides like this: http://ef.readthedocs.org/en/latest/getting-started/aspnet5.html 问题是,即使完全按照这样的指南,我也无法让它们一起运行: http//ef.readthedocs.org/en/latest/getting-started/aspnet5.html

In this example, when I reach the part that I need to run this command: 在这个例子中,当我到达我需要运行此命令的部分时:

dnx . ef migration add MyFirstMigration

I always get this error: 我总是得到这个错误:

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

I tried and retried all the steps and searched for anything I may have missed in my project with no luck. 我尝试并重试了所有步骤,并在没有运气的情况下搜索了我可能在项目中遗漏的任何内容。

This issue is probably because you're using an incorrect (or just buggy) version of the Dot Net Virtual Machine. 这个问题可能是因为您使用的是Dot Net虚拟机的错误(或只是错误)版本。 Try running dnvm list to see which versions you have installed and which one is set to active, then you may need to run dnvm use ... to switch versions. 尝试运行dnvm list以查看已安装的版本以及哪个版本设置为活动版,然后您可能需要运行dnvm use ...来切换版本。

For example, I run dnvm use 1.0.0-rc1-update1 for many of my .csproj apps. 例如,我为许多.csproj应用程序运行dnvm use 1.0.0-rc1-update1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM