-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Hi,
I use the MongoUrlBuilder to extract the database name from a connection string, but the following code throws an exception
var mongoUrl = new MongoUrlBuilder("mongodb+srv://user:pass@host/Database?retryWrites=true") { DatabaseName = null };
ConnectionString = mongoUrl.ToMongoUrl();
MongoConfigurationException
Host for mongodb+srv scheme cannot specify a port.
When I use .ToString() I the following url back:
mongodb+srv://user:pass@host:53/?ssl=true;retryWrites=true
Which then throws the same exception when creating a MongoClient.
- duplicates
-
CSHARP-2459 Do not output port in ToString() for '+srv' urls
- Closed