googleapis / google-cloud-dotnet

Google Cloud Client Libraries for .NET
https://cloud.google.com/dotnet/docs/reference/
Apache License 2.0
932 stars 365 forks source link

Google.Cloud.Datastore.V1 channel creation error under CoreRT #3161

Closed hhblaze closed 5 years ago

hhblaze commented 5 years ago

Environment details

Steps to reproduce

  1. Everything works and runs in standard managed environment. Everything compiles in CoreRT. But when native (CoreRT) runs it shows following problems at this place:

Code of DataStore initialization:

static DatastoreDb gdb;
public static void InitDataStore()
        {
            try
            {

                var credential = Google.Apis.Auth.OAuth2.GoogleCredential.FromJson(GetGCS())
                  .CreateScoped(DatastoreClient.DefaultScopes);

//On the next line (while creating channel) will be thrown exception
                var channel = new Grpc.Core.Channel(DatastoreClient.DefaultEndpoint.ToString(), credential.ToChannelCredentials());

                gdb = DatastoreDb.Create(datastore_projectId, datastore_namespace, DatastoreClient.Create(channel));

Here is a screenshot of the exception: image

jskeet commented 5 years ago

It sounds like this is a bug that should be filed in Grpc.Core, given that the problem is within GrpcEnvironment.GrpcNativeInit. But fundamentally, we don't support CoreRT at the moment. The gRPC team may well be interested in making it work, which would at least be a pre-requisite for our code working.

I suggest you put together a minimal example (which wouldn't need to use Datastore at all - it only needs to call the Channel constructor) and post it in the gRPC repository.

hhblaze commented 5 years ago

ok, thank you!