简体   繁体   中英

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":

在此处输入图片说明

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 ). Mostly sure, Npgsql doesn't support dnxcore50 (CoreCLR).

You have 3 solutions:

  1. Remove dnxcore50 completely
  2. Move the dependency under dnx451
  3. Use #if DNX451 conditional compilation blocks in your code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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