Xamarin Forms IOS 无法加载程序集 System.Net.Http.Primitive [英] Xamarin Forms IOS Failed to load assembly System.Net.Http.Primitive
问题描述
我正在尝试使用 Visual Studio 2015 中的 Xamarin.Forms 为 IOS 应用程序发布版本.
I'm trying to do a release build for an IOS app using Xamarin.Forms in Visual Studio 2015.
在应用程序属性的 iOS 构建菜单下,如果我设置链接器行为仅链接 SDK 程序集或链接所有程序集 - 我收到以下构建错误:
Under the iOS Build menu in the properties of the app, If I set the Linker behaviour Link SDK assemblies only or Link all assemblies - I get the following build error:
无法解析程序集:'System.Net.Http.Primitives,版本=1.5.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a' BlackhawkPlatform.App.iOS
Failed to resolve assembly: 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' BlackhawkPlatform.App.iOS
如果我不链接任何程序集 - 应用程序构建良好,但输出 ipa 超过 40mb big 0,未压缩超过 100mb,因此无法提交到 iTunes Connect.
If I don't link any of the assemblies - the App builds fine but the output ipa is over 40mb big 0 uncompressed over 100mb and as such cannot be submitted to iTunes Connect.
我安装了最新版本的 System.Net 客户端库和 Xamarin Forms.
I have the latest version installed of System.Net Client libraries and Xamarin Forms.
我尝试通过在附加 mtouch 参数框中使用命令 --linkskip=System.Net.Http.Primitives
跳过程序集链接,但这不起作用.
I have tried to skip the assembly link by using the command --linkskip=System.Net.Http.Primitives
in the Additional mtouch argument box but that dos not work.
知道如何解决这个问题吗?
Any idea how I can get around this please?
推荐答案
找到了一个有效的解决方案.
Found a solution which worked.
- 在 Nuget 包管理器中安装最新版本的 Microsoft.BCL.Build v1.0.21
- 然后安装最新版本的 Microsoft.Net.Http v2.2.29
- In Nuget package manager install the latest version of Microsoft.BCL.Build v1.0.21
- then install the latest version of Microsoft.Net.Http v2.2.29
这对我有用.
这篇关于Xamarin Forms IOS 无法加载程序集 System.Net.Http.Primitive的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!