我试图读取数据并将其插入FireStore,并且在此代码后我的应用程序失败->等待newDoc.GetSnapshotAsync(); 我正在使用控制台应用程序,它在该行之后停止。尝试捕获不会捕获任何错误。
try {
GoogleCredential credential = GoogleCredential.FromFile("project.json");
ChannelCredentials channelCredentials = credential.ToChannelCredentials();
Channel channel = new Channel(FirestoreClient.DefaultEndpoint.ToString(), channelCredentials);
FirestoreClient firestoreClient = FirestoreClient.Create(channel);
db = FirestoreDb.Create(projectId, client: firestoreClient);
var collection = db.Collection("users");
var newDoc = collection.Document("x5EkYuk23odfmXZX8KfW");
var qs = await newDoc.GetSnapshotAsync(); <--stops here
}
catch(Exception ex)
{
throw; <-- never hits here
}