In my C# application I'm not able to access my MongoDB Atlas database.
After creating a database on Atlas, I generate the string to access it and add the following lines in my code:
var client = new MongoClient("mongodb+srv://<username>:<password>@cluster0.5kp6i.mongodb.net/?retryWrites=true&w=majority");
var database = client.GetDatabase("DBTest");
The error is always the same. It seems that the MongoDB.Driver.Legacy driver is missing (username and password are obfuscated):
I suppose there is something wrong with the packages installed. I installed the last version of the Mongo Drivers through the Nuget packages manager:
But I tested also some of the previous version of the same packages without any results. What am I doing wrong?
The targeted framework is the 4.8, could it be the cause? I wouldn't want to change that.
Thank you very much!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.