简体   繁体   English

Asp.Net 5 Nuget软件包错误

[英]Asp.Net 5 Nuget package error

I added VNext class library to ASp.Net 5 project, and I'm trying to add Nuget package "Npsql": 我向ASp.Net 5项目添加了VNext类库,并且试图添加Nuget包“ Npsql”:

在此处输入图片说明

But it can't compile, what I'm doing wrong? 但是它不能编译,我在做什么错?

The problem is that when you add the dependency to all TFMs ( dnx451 and dnxcore50 ). 问题是,当您将依赖项添加到所有TFM( dnx451dnxcore50 )时。 Mostly sure, Npgsql doesn't support dnxcore50 (CoreCLR). 可以肯定的是, Npgsql不支持dnxcore50 (CoreCLR)。

You have 3 solutions: 您有3个解决方案:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM