[CSHARP-1726] It is not possible to set Server attribute in MongoClientSettings. it remains 'localhost'. Created: 26/Jul/16 Updated: 07/Feb/17 Resolved: 07/Feb/17 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | API |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jan Sturm | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
windows7 |
||
| Description |
|
this code does not work:(the Server attribute remains: localhost) MongoClientSettings setting = new MongoClientSettings(); i have to clone the current Settings ; |
| Comments |
| Comment by Jan Sturm [ 26/Jul/16 ] |
|
the code snipped was from stackoverflow. shouldn't it throw an exception then ? but yes you can close the issue |
| Comment by Jan Sturm [ 26/Jul/16 ] |
|
i took this code snippet from the internet (codeproject or something), will retry it with dns name only |
| Comment by Robert Stam [ 26/Jul/16 ] |
|
I am unable to reproduce this. When I change the value of the Server property of MongoClientSettings it actually does get a new value. FYI, the host parameter to the MongoServerAddress constructor must be a DNS host name, not a MongoDB URL. Keep in mind that once you pass the MongoClientSettings to a MongoClient constructor its values are frozen. So you can only change the Server value (or any other value) before you create the MongoClient instance. |