Asp.Net 5 Nuget软件包错误 [英] Asp.Net 5 Nuget package error

查看:76
本文介绍了Asp.Net 5 Nuget软件包错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASp.Net 5项目中添加了VNext类库,并且试图添加Nuget包"Npsql":

I added VNext class library to ASp.Net 5 project, and I'm trying to add Nuget package "Npsql":

但是它不能编译,我在做什么错了?

But it can't compile, what I'm doing wrong?

推荐答案

问题是,当您将依赖项添加到所有TFM( dnx451 dnxcore50 )时.可以肯定的是, Npgsql 不支持 dnxcore50 (CoreCLR).

The problem is that when you add the dependency to all TFMs (dnx451 and dnxcore50). Mostly sure, Npgsql doesn't support dnxcore50 (CoreCLR).

您有3种解决方案:

  1. 完全删除 dnxcore50
  2. dnx451
  3. 下移动依赖项
  4. 在代码中使用 #if DNX451 条件编译块
  1. Remove dnxcore50 completely
  2. Move the dependency under dnx451
  3. Use #if DNX451 conditional compilation blocks in your code

这篇关于Asp.Net 5 Nuget软件包错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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