Getting 'MissingMethodException' when trying to use 'dnx. Ef migration add' in EF7 beta6

I am trying to play with ASP.NET 5 beta5 and Entity Framework 7 beta6 in RTM Visual Studio 2015. The problem is that I cannot get them to work together even with the following guides: http://ef.readthedocs.org/en/ latest / getting-started / aspnet5.html

In this example, when I get to 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 repeated all the steps and looked for everything that I might have missed in my project, no luck.

+6
source share
1 answer

This problem is probably related to the wrong (or just an error) version of the Dot Net virtual machine. Try running dnvm list to find out which versions you have installed and which one is 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 applications.

0
source

All Articles