I am using using ASP.NET 5
Beta 8 with Entity Framework 7
Beta 8
I created a new class Library Package.
I ran the following install packages prompts:
Install-Package EntityFramework.SqlServer -Pre
Install-Package EntityFramework.Commands -Pre
Install-Package Microsoft.AspNet.Identity.EntityFramework -Pre
My project.json
{
"version": "1.0.0-*",
"description": "MARS Class Library",
"authors": [ "myname" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"dnx451": { }
},
"dependencies": {
"EntityFramework.Commands": "7.0.0-beta8",
"EntityFramework.SqlServer": "7.0.0-beta8",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta8",
}
}
In my package manager console I navigate to my src\project
directory in which the project.json
is located and run any dnx
ef
command e.g.:
dnx ef migrations --help
or
dnx ef migrations add InitialMigration
However I get the following error:
dnx : Error: Unable to load application or execute command 'ef'.
At line:1 char:1
dnx ef migrations --help
~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (Error: Unable t...e command 'ef'.:String) [], RemoteException
- FullyQualifiedErrorId : NativeCommandError
I have a DBContext class and model classes but the error seems to be related to not being able to understand they keyword ef
at all.
What am I missing?
Solution:
Add the ef
command to your project.json
"commands": {
"ef": "EntityFramework.Commands"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With