I am trying to create a .net core application that has a connection to a sqlite database.
I have .net core sdk 1.0 installed and have added the following Nuget-packages to my project:
I am using the following project.json file:
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.EntityFrameworkCore.Sqlite": "1.0.0",
"Microsoft.EntityFrameworkCore.Sqlite.Design": "1.0.0",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools":
{
"version": "1.0.0-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
}
}
Then I ran the following command:
dotnet restore
Now I want to check if the ef tool has been successfully installed to create a migration. But when I run:
dotnet ef --help
I get the following result:
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
- Alternatively, install the framework version '1.0.0-rc2-3002702'.
Is it possible to installe release candidate 2 together with the 1.0 version and do I really have to do this to get entity framework runnging with .net core 1.0?
I found out how to do this. The changes are based on https://docs.efproject.net/en/latest/miscellaneous/rc2-rtm-upgrade.html.
Here is the complete project.json:
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.EntityFrameworkCore.Design": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.Sqlite": "1.0.0",
"Microsoft.EntityFrameworkCore.Sqlite.Design": "1.0.0",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools":
{
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
}
}
}
and for completeness this is the global.json:
{
"sdk": {
"version": "1.0.0-preview2-003121"
}
}
you have to update both to get to RTM. You can't mismatch versions. Check that your Global.json file has the appropriate
"sdk":{ "version" : "1.0.0-preview2-003121" }
is present.