Get ArgumentNullException when new gRPC channel on UWP release build

0

I am trying to develop UWP with gRPC. I got channel ArgumentNullException on release build, but debug build is fine and gRPC also works fine. It seems to related to UWP limitation (loopback). I also use checknetisolation command to add exception for my package. But it's still fail. Is there any advice?

Updated more information, I already enabled debug trace on release build but callstack is still empty:

  1. If Optimize code of build is checked, ChannelCredentials.Insecure is null.
  2. If Optimize code is unchecked, new Channel() will get ArgumentNullException.

Anyway, ArgumentNullException happens on new Channel().

Code:

var cert = ChannelCredentials.Insecure;
var channel = new Channel("127.0.0.1:55168", cert);

Error:

System.ArgumentNullException: 'Value cannot be null.'

StackTrace

System.ArgumentNullException
  HResult=0x80004003
  Message=Value cannot be null.
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

Output

Exception thrown: 'System.ArgumentNullException' in 
System.Private.CoreLib.dll
Value cannot be null.

Package version:

Google.Protobuf version: 3.15.8
Grpc version: 2.37.0
c#
uwp
grpc
asked on Stack Overflow Apr 29, 2021 by CodeLamb • edited May 3, 2021 by blackgreen

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0