[CSHARP-1746] Can't resolve localhost as part of the connection string Created: 15/Aug/16  Updated: 15/Aug/16  Resolved: 15/Aug/16

Status: Closed
Project: C# Driver
Component/s: Configuration
Affects Version/s: 2.3.0-beta1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Carlos Torrecillas [X] Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

dotnet core on OSX


Issue Links:
Duplicate
duplicates CSHARP-1736 Hostname connect fails on Linux Closed

 Description   

The question was raised in Stackoverflow: http://stackoverflow.com/questions/38772459/connection-to-mongo-db-using-dotnetcore/38772489?noredirect=1#comment65244203_38772489 and there is a workwound for it which I found an added to the thread.

Essentially the MongoClient throws an exception when trying to connect using localhost as part of its connection string. If you however change the name for the ip address it works. So I changed it from localhost to 127.0.0.1 and I could connect successfully.



 Comments   
Comment by Craig Wilson [ 15/Aug/16 ]

This is simply an issue of Socket not supporting hostnames on non-windows platforms. It has been fixed in CSHARP-1736.

Generated at Wed Feb 07 21:40:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.