相关疑难解决方法(0)

更新到Visual Studio 2017版本15.8预览后"无法解析引用:`System.Memory`"或"找不到`System.Memory`"

如果它可以帮助其他任何人,我会询问并回答这个小问题,该问题可以在从Visual Studio 2017版本15.7更新到15.8版预览版之后出现在Xamarin.Android和Xamarin.iOS项目中.

演示此问题的示例步骤

  1. 创建一个新的空白Xamarin.Android或Xamarin.iOS项目.
  2. 将Microsoft.AspNetCore.SignalR.Client.Core版本1.0.0 NuGet包添加到项目中.
  3. 使用项目中NuGet包中的类型.例如,将以下行添加到任何现有方法:

    var connection = new Microsoft.AspNetCore.SignalR.Client.HubConnectionBuilder().Build();
    
    Run Code Online (Sandbox Code Playgroud)
  4. 对于Xamarin.Android,尝试在Debug配置中构建项目.对于Xamarin.iOS,在iPhone模拟器上的Debug配置中构建并运行应用程序.

Visual Studio 2017 15.7版的结果

Xamarin.Android应用程序和Xamarin.iOS应用程序都可以无错误地构建和运行.

Visual Studio 2017版本15.8预览版4的结果

对于Xamarin.Android,构建失败:

Xamarin.Android.Common.targets(1831,2): error XA2002: Can not resolve reference: `System.Memory`, referenced by `Microsoft.AspNetCore.Connections.Abstractions`. Please add a NuGet package or assembly reference for `System.Memory`, or remove the reference to `Microsoft.AspNetCore.Connections.Abstractions`.
Xamarin.Android.Common.targets(1831,2): error XA2002: Can not resolve reference: `System.Memory`, referenced by `Microsoft.AspNetCore.SignalR.Client.Core`. Please add a NuGet package or assembly reference for `System.Memory`, or remove the reference to `Microsoft.AspNetCore.SignalR.Client.Core`.
Xamarin.Android.Common.targets(1831,2): error XA2002: …
Run Code Online (Sandbox Code Playgroud)

xamarin.ios xamarin.android xamarin

9
推荐指数
2
解决办法
5533
查看次数

标签 统计

xamarin ×1

xamarin.android ×1

xamarin.ios ×1