.NET Core 1.0 and EntityFramework 7 Not Compatible

.net-core asp.net-core entity-framework-core visual-studio-code

Question

I've upgraded to Visual Studio Code 1.0.0 and I'm trying to retrofit an ASP.NET Core project I was working on in VSCode previously, before the new release. VSCode is seemingly quite different now in terms of configuration. I've worked with this tutorial and these samples. I'm having reasonable success getting the MVC6 aspect of my project compiling and working properly, but the EntityFramework 7 aspect is a no-go.

When I do a dotnet restore on my project, I get the following error:

Package EntityFramework.Core 7.0.0-rc1-final is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0).

I've been experimenting more-or-less randomly with the project.json in the hopes of finding a solution, but I don't seem to be making much progress. Is netcoreapp1.0 still just too new to be retro-compatible with EntityFramework? What options are available?

Here's my project.json, by the way. It's pretty much stock from the HelloMvcApi sample mentioned above, but with the addition of the EntityFramework.Core dependency:

{
  "compilationOptions": {
    "emitEntryPoint": true,
    "debugType": "portable"
  },
  "dependencies": {
    "Microsoft.AspNetCore.Mvc.Core": "1.0.0-*",
    "Microsoft.AspNetCore.Mvc.Formatters.Json": "1.0.0-*",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
    "Microsoft.Extensions.Logging.Console": "1.0.0-*",
    "EntityFramework.Core": "7.0.0-rc1-final",
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.0-*"
    }
  },
  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "portable-net45+wp80+win8+wpa81+dnxcore50"
      ]
    }
  },
  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-*",
      "imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
    }
  },
  "scripts": {
    "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
  }
}
1
3
4/20/2016 3:57:25 PM

Accepted Answer

As mentioned in this announcement of breaking changes in RC2 :

The EntityFramework.* packages and namespaces are changing to Microsoft.EntityFrameworkCore.*

So you'll just need to switch your reference to point to the updated version :

"Microsoft.EntityFrameworkCore": "1.0.0-*",
8
4/20/2016 4:07:30 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