简体   繁体   中英

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. 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

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. 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.

For example, I run dnvm use 1.0.0-rc1-update1 for many of my .csproj apps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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