.net Core 2.0 - 使用 .NetFramework 4.6.1 而不是目标框架 .netCore 2.0 来恢复包.软件包可能不完全兼容 [英] .net Core 2.0 - Package was restored using .NetFramework 4.6.1 instead of target framework .netCore 2.0. The package may not be fully compatible

查看:22
本文介绍了.net Core 2.0 - 使用 .NetFramework 4.6.1 而不是目标框架 .netCore 2.0 来恢复包.软件包可能不完全兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 .net core 2.0 控制台应用程序.我正在尝试使用以下方法从 TFS 读取文件:

<块引用>

使用.NETFramework,Version=v4.6.1"而不是项目目标框架.NETCoreApp,Version=v2.0"恢复了包Microsoft.AspNet.WebApi.Client 5.2.2".此软件包可能与您的项目不完全兼容.

即使在取消警告后,我仍然收到错误并且无法引用库.我怎样才能得到这个参考解析?

非常容易复制:

  1. 新的 .net core 2.0 控制台应用
  2. 复制上述问题的方法
  3. 尝试安装nuget包

解决方案

该软件包目前不完全兼容 dotnetcore 2.0.

例如,对于 'Microsoft.AspNet.WebApi.Client' 它可能在版本 (5.2.4) 中得到支持.有关详细信息,请参阅使用新的 Microsoft.AspNet.WebApi.Client.5.2.4 包.

您可以尝试将 标准客户端 包作为费德里科提到.

如果这仍然不起作用,那么作为一种解决方法,您只能创建一个 控制台应用程序 (.Net Framework) 而不是 .net core 2.0 控制台应用程序.

参考此线程:Microsoft.AspNet.WebApi.NET Core 是否支持 .Client?

I have a .net core 2.0 console app. I'm trying to read files from TFS using the following:

How to get a file from TFS directly into memory (i.e., don't want to read from file system into memory)?

I head over to nuget and install Microsoft.TeamFoundationServer.ExtendedClient and run into this:

Package 'Microsoft.AspNet.WebApi.Client 5.2.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.

Even after suppressing the warning, I still get the error and can't reference the library. How can I get this reference resolving?

Very easy to repro:

  1. New .net core 2.0 console app
  2. Copy the method from the above question
  3. Try to install the nuget package

解决方案

The package is not fully compatible with dotnetcore 2.0 for now.

eg, for 'Microsoft.AspNet.WebApi.Client' it maybe supported in version (5.2.4). See Consume new Microsoft.AspNet.WebApi.Client.5.2.4 package for details.

You could try the standard Client package as Federico mentioned.

If that still not work, then as a workaround you can only create a Console App (.Net Framework) instead of the .net core 2.0 console app.

Reference this thread: Microsoft.AspNet.WebApi.Client supported in .NET Core or not?

这篇关于.net Core 2.0 - 使用 .NetFramework 4.6.1 而不是目标框架 .netCore 2.0 来恢复包.软件包可能不完全兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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