Last version of MongoDB.Driver not working for Android 8+: Could not find file “/etc/resolv.conf”

443 views Asked by At

I use last MongoDB.Driver v2.12.4 in my Xamarin VS project for Android 10. When i try to read data from server i get Exeption: Error resolving name servers (Object reference not set to an instance of an object.) (Could not find file “/etc/resolv.conf”) —> System.NullReferenceException: Object reference not set to an instance of an object. MongoDB.Driver used DNSClient and it cannot get dns servers correct in android 8+.

Discussion of this problem is here Need help connecting to MongoDB cluster on Android, but it solution working only for driver version 2.7.0. How can i configure last version MongoDB.Driver connection correct?

1

There are 1 answers

1
Знаешь-Ли Тыыыыыы On

There was the same problem. Rolled back Mongo.Driver up to version 2.4.4., changed the connection string as written in the Atlas, and everything works.