Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EF7 .NET Core 1 RC2 Add-Migration failing

Tags:

I recently installed .NET Core 1.0 RC2, and I know that the command DNX have changed to the dotnet.exe command, But know I can't found how to create new EF7 Migration file. Whatever I try the "dotnet ef" command I get

dotnet : No executable found matching command "dotnet-ef"
At line:1 char:1
+ dotnet ef
+ ~~~~~~~~~
    + CategoryInfo          : NotSpecified: (No executable f...and "dotnet-ef":String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

And something similar, if a try the "Add-Migration" command from within the VS PS Console witch give me this :

Add-Migration : The term 'Add-Migration' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Add-Migration
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I'm googling since 3 hours without any result.

I feel like a package is missing.

Is someone here have successfully created a new EF7 migration class. after installing RC2?

like image 863
Hugo Avatar asked May 26 '16 18:05

Hugo


1 Answers

The commands are in Tools package, so run following command in the Package Manager Console (or add the package through the NuGet package manager UI):

Install-Package Microsoft.EntityFrameworkCore.Tools –Pre

A few days ago I pushed a small app with EF Core 1 RC2 to GitHub, in which the Add-Migration worked. You can use it as a reference if necessary.

like image 142
Bart Avatar answered Sep 28 '22 04:09

Bart