[CSHARP-2453] Latest DnsClient breaks API compatibility Created: 12/Dec/18  Updated: 28/Oct/23  Resolved: 02/Jan/19

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: 2.7.2
Fix Version/s: 2.8.0

Type: Improvement Priority: Major - P3
Reporter: John Murphy Assignee: Robert Stam
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

DnsClient nuget package version 1.2.0


Issue Links:
Duplicate
is duplicated by CSHARP-2330 DnsClient.IDnsQueryResponse exception... Closed
Related
related to CSHARP-2330 DnsClient.IDnsQueryResponse exception... Closed
is related to CSHARP-2462 MongoDB.Driver.Core errors in .netSta... Closed
Case:

 Description   

Version 1.2.0 of the DnsClient nuget package changed the LookupClient.QueryAsync() signature which breaks MongoDB.Driver.Core.Configuration.ConnectionString.ResolveAsync.

Also version 1.2.0 results in a MissingMethodException at runtime:

System.MissingMethodException was unhandled
 HResult=-2146233069
 Message=Method not found: 'DnsClient.IDnsQueryResponse DnsClient.LookupClient.Query(System.String, DnsClient.QueryType)'.
 Source=MongoDB.Driver.Core
 StackTrace:
 at MongoDB.Driver.Core.Configuration.ConnectionString.Resolve()
 at MongoDB.Driver.MongoUrl.Resolve()
 at MongoDB.Driver.MongoClientSettings.FromUrl(MongoUrl url)
 at MongoDB.Driver.MongoClient..ctor(MongoUrl url)



 Comments   
Comment by Robert Stam [ 02/Jan/19 ]

ghendo@me.com I don't know exactly what caused the error you were seeing, but we have updated the dependency on DnsClient to version 1.2.0. This change will be in version 2.8.0 of the driver.

Comment by Githook User [ 02/Jan/19 ]

Author:

{'username': 'rstam', 'email': 'robert@robertstam.org', 'name': 'rstam'}

Message: CSHARP-2453: Update DnsClient reference to 1.2.0.

Signed-off-by: rstam <robert@robertstam.org>
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/94ee2901df4f1b9f5fbd3f877ae75f24f6a9c5b0

Comment by Graeme Henderson [ 24/Dec/18 ]

Is this problem the reason I get the following on deploy self contained  to linux

[ec2-user@ip-10-0-10-73 linux-x64]$ ./WebApplication3
Error:
An assembly specified in the application dependencies manifest (WebApplication3.deps.json) was not found:
package: 'DnsClient', version: '1.0.7'
path: 'lib/netstandard1.3/DnsClient.dll'

Would there be any work around?

Comment by Robert Stam [ 20/Dec/18 ]

The DnsClient package we reference made backward breaking changes between the 1.0.7 version we originally referenced and the current 1.2.0 version.

The only thing we can do to work around this is to update our reference to version 1.2.0 and make the necessary changes to the driver to adapt to the breaking changes.

This does mean that any application using our driver that also wishes to reference DnsClient (directly or indirectly) will have to use version 1.2.0 of DnsClient also (or a newer version if the author of DnsClient doesn't break backward compatibility again).

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