How to enable migrations (EF6) in an asp.net 5 project?

asp.net-core entity-framework-6

Question

In order to represent the data layer, I started a new class library (package) project (VS 2015 RC used the even worse moniker of asp.net class library). Just to be clear, this structure is the more recent kproj approach.

Project has EF 6.1.3 added. json. DNX451 is the only target right now.

   "dependencies": {
        "EntityFramework": "6.1.3"
        ,"Moq": "4.2.1502.911"
    },

Everything functions as intended after creating the basic model classes and using an AlwaysCreate database initializer. Now that migrations are required, using Enable-Migrations in the package manager console produced the following results:

Enable-Migrations : The term 'Enable-Migrations' 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
+ Enable-Migrations
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Enable-Migrations:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

The package manager is not supported for migration commands for EF7 migrations. There is a new ef command that is run through dnu in its place, however I believe that it is only for EF7 and not EF6.

Why, despite the fact that EF6 has been mentioned, does the package manager believe Enable-Migrations to be invalid?

1
11
5/13/2015 4:18:56 PM

Popular Answer

ZZZ_tmp
4
6/28/2016 5:06:18 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow