无法在V​​S2015网络工程安装的EntityFramework 6.1.3 [英] Unable to install EntityFramework 6.1.3 in VS2015 web project

查看:872
本文介绍了无法在V​​S2015网络工程安装的EntityFramework 6.1.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的VS2015的WebAPI项目,我尝试使用从包管理器下面的命令来安装的NuGet包的EntityFramework 6.1.3。该命令成功,如下所示消息运行。但包还是没有安装,我得到一个错误,当我编译项目:

In my VS2015 WebApi project, I try to install NuGet package EntityFramework 6.1.3 using the following command from Package Manager. The command runs with success as the message below shows. But the package is still not installed and I get an error when I compile the project:

PM> Install-Package EntityFramework
Installing NuGet package EntityFramework.6.1.3.
Successfully installed 'EntityFramework 6.1.3' to myWebProjectName

编译错误
错误NU1001依存的EntityFramework> = 6.1.3无法解析。 myWebProjectName C:\\的WebAPI \\ ProductService的\\ src \\ ProductService \\ project.json

The compile error: Error NU1001 The dependency EntityFramework >= 6.1.3 could not be resolved. myWebProjectName C:...\WebAPI\ProductService\src\ProductService\project.json

这是我project.json文件

{
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "EntityFramework": "6.1.3",
    "Microsoft.ApplicationInsights.AspNet": "1.0.0-rc1",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
    "Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
    "Microsoft.AspNet.WebApi.OData": "5.7.0",
    "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final"
  },

  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel",
  },

  "frameworks": {
    "dnx451": { },
    "dnxcore50": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules"
  ],
  "publishExclude": [
    "**.user",
    "**.vspscc"
  ]
}

更新

在该项目的参考文件夹为空,并且有安装为显示在项目下面的截图没有的NuGet包:

The Reference folder in the project is empty and there are no NuGet packages installed as shown in the project screenshots below:

在这里输入的形象描述

解决方案资源管理器窗口:

Solution Explorer Window:

在这里输入的形象描述

更新2

在我关上了项目,并重新打开它,参考文件夹中显示两个文件夹DNX 4.5.1和DNX Core5.0一些错误图标,如下图所示:

After I closed the project and re-opened it, the Reference folder is showing two folders DNX 4.5.1 and DNX Core5.0 with some error icons as shown below:

在这里输入的形象描述

推荐答案

我假设你使用ASP.NET 5模板来创建Web API项目。

I'm assuming you used the ASP.NET 5 template to create your Web API project.

右键单击您的引用文件夹,在您的项目,然后单击还原包。然后重建。

Right click on your references folder, in your project, and click "Restore Packages". Then rebuild.

我不认为实体框架6支持DNX核心。所以,你可能需要删除该引用为好。下DNX核心5.0EntityFramwork单击鼠标右键,单击卸载程序包。

I don't think Entity Framework 6 is supported for DNX Core. So you might have to remove that reference as well. Right-click on "EntityFramwork" under DNX Core 5.0 and click Uninstall Package.

你看到DNX这样的东西形象?

Do you see the DNX stuff like in this image?

在这里输入的形象描述

这篇关于无法在V​​S2015网络工程安装的EntityFramework 6.1.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆