Connecting to mainnet via C# gRPC Client

Hello,

I’m receiving an error when attempting to connect to the mainnet via gRPC calls.
This is simply my code. I’ve created a .proto file with only the Ping methods and Messages.

string url = "https://access.mainnet.nodes.onflow.org:9000";

Channel channel = new Channel(url, ChannelCredentials.Insecure);
var client = new AccessAPI.AccessAPIClient(channel);

PingResponse var = client.Ping(new PingRequest());
Console.WriteLine(var);

I’m receiving the following error:

Grpc.Core.RpcException: 'Status(StatusCode="Unavailable", Detail="DNS resolution failed for service: https://access.mainnet.nodes.onflow.org:9000", 

Looking for some help on connecting a C# gRPC client to any of the mainnets. Thanks!

Got it.

// Main API Source
            string uri = "access.mainnet.nodes.onflow.org:9000";

            Channel channel = new Channel(uri, ChannelCredentials.Insecure);
            var client = new AccessAPI.AccessAPIClient(channel);

            // Get Block Info
            BlockResponse reply = client.GetLatestBlock(new GetLatestBlockRequest { IsSealed=true });
            Block latestBlock = reply.Block;