Forum Visual Studio

Xamarin Forms, Unable to resolve DNS on Android?

Hi folks,

Still new to Xamarin, so sorry if this is an obvious question.

I have been following the sample todo list code on the microsoft site, to connect my Xamarin Forms app to a Cosmos Mongo DB on Azure.

I've made my own project using this code to connect to my own CosmosDB, but any time I try to query the database, I get the following error:

System.AggregateException: 'Error resolving name servers (Value cannot be null. Parameter name: source) (Could not find file "/etc/resolv.conf")'

I've downloaded and ran the sample code on my device and it runs fine, and connects to the Cosmos DB I have created.

Would anybody be able to point me in the right direction on this?



  • hs79hshs79hs AUMember ✭✭

    I got this issue too. It turns out that till now, MongoDB Driver on Xamarin Android hasn't supported DNS Seedlist Connection Format (starts from "mongodb+srv://"). So you have to use Standard Connection String Format (starts from "mongodb://").

    Please find your Standard Connection String and try it.

    Refer to this

Sign In or Register to comment.