Michael
Michael

Reputation: 8761

microsoft.data.entity missing from MVC 6 (Visual Studio 2015)

I have created a MVC 6 project in Visual Studio 2015.

I am trying to create a Code First Entity framework class library

{
    "version": "1.0.0-*",
    "description": "DB Class Library",
    "authors": [ "Michael" ],
    "tags": [ "" ],
    "projectUrl": "",
    "licenseUrl": "",

    "dependencies": {
        "System.Collections": "4.0.10-beta-23019",
        "System.Linq": "4.0.0-beta-23019",
        "System.Threading": "4.0.10-beta-23019",
        "System.Runtime": "4.0.10-beta-23019",
    "Microsoft.CSharp": "4.0.0-beta-23019",
        "System.ComponentModel.Annotations": "4.0.10",
        "System.Data.Entity.Repository": "2.0.0.1",
        "EntityFramework.SqlServer": "7.0.0-beta5",
        "EntityFramework.Commands": "7.0.0-beta5",
        "Microsoft.Data.Edm": "5.6.5-beta"
    },
    "frameworks": {
        "dotnet": { }
    }
}

This is my project.json file.

The tutorial now says I should add "Microsoft.Data.Entity" However I am missing this reference so I'm not able to add this library. I need this library so I can create my DBContext class.

Upvotes: 4

Views: 2050

Answers (2)

beachgeek
beachgeek

Reputation: 13

Had the same problem, the project did not load all the libraries in the beginning. Added the hot fix and all is well now.

Problem : Opening Package Manager Console produces the message:

"Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will retain its current effective execution policy of Unrestricted. Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information please see "Get-Help Set-ExecutionPolicy"."

But no PowerShell prompt ever appears. Similarly, attempting to install a package produces the same message on attempting to execute the script file from the package, followed by:

Install failed. Rolling back...

Attempting to upgrade an existing package instead produces:

Failed to initialize the PowerShell host. If your PowerShell execution policy setting is set to AllSigned, open the Package Manager Console to initialize the host first.

Solution Explained and hot fix links available in https://github.com/NuGet/Home/issues/974#issuecomment-124774650 A hotfix is now available to install and we are confident it will unblock you. Please grab the install from one of these locations appropriately:

3.1.1 for VS 2015: https://github.com/NuGet/Home/releases/download/3.1.1/NuGet.Tools.vsix

We will publish these to the Visual Studio gallery next week.

Upvotes: 1

Ian Overton
Ian Overton

Reputation: 1060

Change dotnet to dnx451

"frameworks": {
        "dnx451": { }
    }

Upvotes: 0

Related Questions