I am trying to learn the basics of ASP.NET Core using this tutorial:
- I have created a ASP.NET Core web application
- I have upgraded it using instruction from here
Now, I am trying to setup the database migration using dotnet ef migrations add Initial
from command prompt within project's folder (where project.json is located):
No executable found matching command "dotnet-ef"
I have changed project.json, so that dotnet-ef works:
"tools": {
...
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
Now, the generation fails with the following error:
The specified framework 'Microsoft.NETCore.App', version '1.0.0-rc2-3002702' was not found. - Check application dependencies and target a framework version installed at: C:\Program Files\dotnet\shared\Microsoft.NETCore.App - The following versions are installed: 1.0.0 1.0.1 1.1.0 - Alternatively, install the framework version '1.0.0-rc2-3002702'
Ok, it makes sense, because Microsoft.EntityFrameworkCore.Tools 1.0.0-preview1-final relies on the old version mentioned in the error, as found in the project.lock.json file.
I don't want to downgrade, so I put the latest version of Microsoft.EntityFrameworkCore.Tools I could find:
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
},
Doing this will lead to the same error:
No executable found matching command "dotnet-ef"
How can I make it work in version 1.1?
Other context information that might be useful:
OS: Windows 7 x64 VS: 2015 Community Edition Other parts from project.json:
"frameworks": {
"netcoreapp1.1": {
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"runtimes": {
"win7-x64": {}
},