I have used mongoDb with .net I have loaded mongodbdriver core and BSon from visual studio add-in manager for mongodb .net core version 2.2 * Now when i try to create a database and added some collection into it. It has giving me an error like below:
public async void insert(FilePath file)
{
try
{
IMongoCollection<FilePath> collection = _db.GetCollection<FilePath>("FilePath");
await collection.InsertOneAsync(file);
}
catch { };
}
Exception:
A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "1", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/localhost:27017" }", EndPoint: