question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Method not found: System.Buffers.ReadOnlySequence when doing grpc-web from iOs Xamarin

See original GitHub issue

What version of gRPC and what language are you using?

Grpc.Net.Client 2.35.0 Grpc.Net.Client.Web 2.35.0

What operating system (Linux, Windows,…) and version?

iOs Xamarin

What did you do?

Simple solution dont work with iOs and Grpc.Net.Client.Web with iOs when trying make simple request, when Andoid version works without issues

What did you expect to see?

Working grpc-web request

What did you see instead?

Status(StatusCode="Internal", Detail="Error starting gRPC call. MissingMethodException: Method not found: System.Buffers.ReadOnlySequence`1<byte> Grpc.Core.DeserializationContext.PayloadAsReadOnlySequence()", DebugException="System.MissingMethodException: Method not found: System.Buffers.ReadOnlySequence`1<byte> Grpc.Core.DeserializationContext.PayloadAsReadOnlySequence() 
at Grpc.Net.Client.StreamExtensions.ReadMessageAsync[TResponse] (System.IO.Stream responseStream, Grpc.Net.Client.Internal.GrpcCall call, System.Func`2[T,TResult] deserializer, System.String grpcEncoding, System.Boolean singleMessage, System.Threading.CancellationToken cancellationToken) [0x004ef] in <d2d9cece439e4d8489b25faa43119c3a>:0 
at Grpc.Net.Client.Internal.GrpcCall`2[TRequest,TResponse].RunCall (System.Net.Http.HttpRequestMessage request, System.Nullable`1[T] timeout) [0x003e3] in <d2d9cece439e4d8489b25faa43119c3a>:0 ") 
at ProtoBuf.Grpc.Internal.Reshape.UnaryTaskAsyncImpl[TRequest,TResponse] (Grpc.Core.AsyncUnaryCall`1[TResponse] call, ProtoBuf.Grpc.Internal.MetadataContext metadata, System.Threading.CancellationToken cancellationToken) [0x0013c] in <69a2f5ff9c0a4440b4f06a1d273a112f>:0 

Anything else we should know about your project / environment?

I use protobuf-net.Grpc for contracts but i doubt error comes from there.

Created repository where i could reproduce issue. https://github.com/valentasm1/grpcissue

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
valentasm1commented, Mar 14, 2021

Can confirm that adding these libraries to iOs project helped and it works now. I must emphasize “IncludeAssets” part which is must be there, so you need to add packages via editing csproj file by hand. So many mentioning in that issue so hopefully it will be solved in future 😃. Closing

 <ItemGroup>
    <PackageReference Include="System.Memory" Version="4.5.4">
      <IncludeAssets>none</IncludeAssets>
    </PackageReference>
    <PackageReference Include="System.Buffers" Version="4.5.1">
      <IncludeAssets>none</IncludeAssets>
    </PackageReference>
  </ItemGroup>
1reaction
valentasm1commented, Mar 14, 2021

Same thing. I dont have time today to try other things, but this case looks very similar to mine 😃. I will try workarounds from there and let you know https://github.com/mono/mono/issues/20805

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Boolean Xamarin.Forms.Internals.ResourceLoader. ...
I have mistake in file "App.xaml.cs", line "InitializeComponent();": System.MissingMethodException HResult=0x80131513. Message = Method not ...
Read more >
"Can not resolve reference: `System.Memory`" or "Could ...
I use VS Entreprise 2017 Version 15.9.1. To solve the problem I face ( Can not resolve reference: System.Buffers , referenced by System....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found