I created a new class library (package) project (prior to VS 2015 RC used the even worse name of asp.net class library to represent the data layer. Just to be clear this is the newer kproj style structure.
Added EF 6.1.3 to project.json. Currently only targeting DNX451.
"dependencies": {
"EntityFramework": "6.1.3"
,"Moq": "4.2.1502.911"
},
Created initial model classes and using a AlwaysCreate database initializer everything works fine. Now need to switch to migrations so used Enable-Migrations in the package manager console and got:
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
For EF7 migrations the package manager is not supported for migration commands. Instead there is a new ef command run through dnu but that new process is just for EF7 not EF6 right?
Why does package manager think Enable-Migrations is invalid even though EF6 has been referenced?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…