[英]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.