Google Firestore DB always returns database not found
20:52 08 Feb 2026

I created a Firestore DB in the Google Cloud Console and when trying to do AddAsync for the document I always get database not found.

the code I am using is below. Not sure what I am doing wrong. I followed the

https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/userguide

I am using .NET client library 4.1.x. any pointers would help.

FirestoreDbBuilder firestoreDbBuilder = new FirestoreDbBuilder
        {
            ProjectId = projectId,
            Credential = tokenCredentialGcp,
            DatabaseId = "test-details-db" // this is already created in the consolse.
        };

        var db = firestoreDbBuilder.Build();
        

       // FirestoreDb db1 = FirestoreDb.Create(projectId);

         Console.WriteLine($"FirestoreDb instance built successfully. {db.DatabaseId}");

         var collection = db.Collection("testrawdata").Document("testuser");
         Console.WriteLine($"Firestore collection reference obtained. {collection.Id}");
google-cloud-platform google-cloud-firestore google-cloud-storage google-cloud-datastore