Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EntityFramework 6.1.3 does not support framework .NETPlatform,Version=v5.4 on visual studio 2015

Any idea why I receive the following error after Nuget installing Entity framework 6.1.3?

Error notice: "The dependency EntityFramework 6.1.3 in project foo bar does not support framework .NETPlatform,Version=v5.4"

Here's my global.json (edited out personal data)

{
  "version": "1.0.0-*",
  "description": foo bar Class Library",
  "authors": [ "foo bar" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",
  "frameworks": {
    "net451": { },
    "dotnet5.4": {
      "dependencies": {
        "Microsoft.CSharp": "4.0.1-beta-23516",
        "System.Collections": "4.0.11-beta-23516",
        "System.Linq": "4.0.1-beta-23516",
        "System.Runtime": "4.0.21-beta-23516",
        "System.Threading": "4.0.11-beta-23516"
      }
    }
  },
  "dependencies": {
    "EntityFramework": "6.1.3"
  }
}
like image 957
JrD Avatar asked Dec 10 '15 20:12

JrD


3 Answers

I solved by deleting this line - "net451": { },, and then replacing "dotnet5.4" with "net451".

like image 126
Don Avatar answered Nov 07 '22 01:11

Don


I had a same issue with EF7 and I was able to solve it by changing dotnet54 to netcore50 in project.json in my EF library and every project depending on it.

like image 45
Martin Vich Avatar answered Nov 07 '22 03:11

Martin Vich


I solved it by just cutting the

"dependencies": { "EntityFramework": "6.1.3" }

dependencies into .Net4.51

"net451": {
  "dependencies": {
    "EntityFramework": "6.1.3",
    "Microsoft.AspNet.Identity.Core": "2.2.1",
    "Microsoft.AspNet.Identity.EntityFramework": "2.2.1"
  }

Final Look

    {
  "version": "1.0.0-*",
  "description": "EMS.Identity Class Library",
  "authors": [ "SamuelA" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",
  "frameworks": {
    "net451": {
      "dependencies": {
        "EntityFramework": "6.1.3",
        "Microsoft.AspNet.Identity.Core": "2.2.1",
        "Microsoft.AspNet.Identity.EntityFramework": "2.2.1"
      }
    },
    "dotnet5.4": {
      "dependencies": {
        "Microsoft.CSharp": "4.0.1-beta-23516",
        "System.Collections": "4.0.11-beta-23516",
        "System.Linq": "4.0.1-beta-23516",
        "System.Runtime": "4.0.21-beta-23516",
        "System.Threading": "4.0.11-beta-23516"
      }
    }
  }
}
like image 27
sam akosh Avatar answered Nov 07 '22 03:11

sam akosh