简体   繁体   English

在Visual Studio 2017中安装Microsoft.Net.Http时出现Nuget错误Microsoft.Bcl.Build

[英]Nuget Error Microsoft.Bcl.Build while installing Microsoft.Net.Http in Visual studio 2017

I have a project in Xamarin Forms and I want to consume service from an external page. 我有一个Xamarin Forms项目,我想从外部页面使用服务。 I am trying to install the package Microsoft.Net.Http to consume such services and gives me the following error: 我正在尝试安装软件包Microsoft.Net.Http以使用此类服务​​,并给我以下错误:

Could not install package 'Microsoft.Bcl.Build 1.0.14'. 无法安装软件包“ Microsoft.Bcl.Build 1.0.14”。 You are trying to install this package in a project that has 'MonoAndroid, Version = v6.0' as the destination, but the package does not contain assembly references or content files that support that framework. 您正在尝试将此软件包安装在以“ MonoAndroid,Version = v6.0”作为目标的项目中,但是该软件包不包含支持该框架的程序集引用或内容文件。 For more information, contact the author of the package. 有关更多信息,请联系软件包的作者。 0] 0]

In the error message there must be specified the Target Framework Version which is in conflict with Xamarin.Forms v6.0 If you have a "packages.config" file in your Droid project, look for this line inside: 在错误消息中,必须指定与Xamarin.Forms v6.0冲突的目标框架版本。如果您的Droid项目中有“ packages.config”文件,请在内部查找以下行:

<package id="Xamarin.Forms" version="2.4.0.280" targetFramework="monoandroid71" />

And replace "monoandroid60" with the proper one. 并用适当的替换“ monoandroid60” I had this trouble installing Microsoft.Net.Http and I could resolve with it. 我在安装Microsoft.Net.Http时遇到了麻烦,可以解决它。 Just try... 你试一试...

On the other hand, if you can try with System.Net.Http package, last version is only some days ago. 另一方面,如果可以尝试使用System.Net.Http包,则最新版本仅在几天前。 I hope it helps. 希望对您有所帮助。

Just had the same or similar issue and solved it by manually installing the Microsoft.Bcl nuget package before installing the Microsoft.Net.Http package. 刚结束了相同或相似的问题,并通过安装Microsoft.Net.Http包之前手动安装Microsoft.Bcl NuGet包解决它。

It might also help to update the Xamarin nuget packages. 它还可能有助于更新Xamarin nuget软件包。

(Idea from Workaround mentioned here: Source ) (来自此处的替代方法的想法: 来源

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

相关问题 无法安装NuGet包Microsoft.Bcl.Build 1.0.14 - Cannot install NuGet package Microsoft.Bcl.Build 1.0.14 Xamarin.Forms (.Net Standard) 中的 Microsoft.Bcl 和 Microsoft.Bcl.Build 不兼容 - Microsoft.Bcl and Microsoft.Bcl.Build in Xamarin.Forms (.Net Standard) Not compatible 如何绕过 Microsoft.Bcl.Build 警告 - How to bypass Microsoft.Bcl.Build warning 警告:所有引用 MyProject.csproj 的项目都必须安装 nuget 包 Microsoft.Bcl.Build - warning : All projects referencing MyProject.csproj must install nuget package Microsoft.Bcl.Build 不使用包恢复,但仍然得到“必须安装nuget包Microsoft.Bcl.Build” - Not using package restore, but still getting “must install nuget package Microsoft.Bcl.Build” VS2017不包含Microsoft.Bcl.Build,但VS2015包含 - VS2017 does not include Microsoft.Bcl.Build, yet VS2015 does 从Visual Studio安装Microsoft.net和NuGet最新版本时出错 - Error while installing Microsoft.net and NuGet latest version from visual studio DevOps CI 管道未能声明 Microsoft.Bcl.Build - DevOps CI pipe is failing claiming Microsoft.Bcl.Build 引用子项目的所有项目必须安装NuGet包Microsoft.Bcl.Build(C#/ Windows Phone 7)? - All projects referencing sub-project must install NuGet package Microsoft.Bcl.Build (C#/Windows Phone 7)? 为什么 Xamarin 应用程序看不到使用 microsoft.net.http - Why Xamarin app not see using microsoft.net.http
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM