捕获异常未找到方法:iOS 上的 Microsoft.AspNetCore.Http.Connections.NegotiationResponse

Cur*_*s-C 9 ios signalr xamarin.forms

该代码似乎适用于Xamarin.Forms中的UWP,但是当我在iOS上尝试此操作时,出现以下错误

捕获异常未找到方法:Microsoft.AspNetCore.Http.Connections.NegotiationResponse Microsoft.AspNetCore.Http.Connections.NegotiateProtocol.ParseResponse

iOS中是否需要更新某些内容才能实现此功能?

我正在使用Microsoft.AspNetcore.SignalrClient v 5.0.4

这在以前的版本中有效,有什么想法吗?

Dec*_*oth 12

您可能会在这里找到解决方法:

https://github.com/mono/mono/issues/20805#issuecomment-841321110

基本上解决方案是修改 iOS.csproj 文件以包含

    <PackageReference Include="System.Buffers">
      <Version>4.5.1</Version>
      <IncludeAssets>none</IncludeAssets>      
    </PackageReference>
    <PackageReference Include="System.Memory">
      <Version>4.5.4</Version>
      <IncludeAssets>none</IncludeAssets>      
    </PackageReference>
Run Code Online (Sandbox Code Playgroud)

就像在这个提交中一样

在此输入图像描述