[CSHARP-4098] Include more detail when throwing PlatformNotSupportedException errors Created: 14/Mar/22  Updated: 04/May/22  Resolved: 26/Mar/22

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.15.1

Type: Improvement Priority: Major - P3
Reporter: Alex Bevilacqua Assignee: Boris Dogadov
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Epic Link: Quick Wins
Case:

 Description   

When a System.PlatformNotSupportedException is raised it is not clear which library failed to load.

For example in the following test case it's not clear the failure is due to the zstd compressor failing when targeting Any CPU vs. x64:

[TestMethod]
public void TestMethodFails()
{
    MongoClient client = new MongoClient("mongodb://localhost:27017/?compressors=zstd,zlib,snappy");
    IMongoDatabase db = client.GetDatabase("test");
    IMongoCollection<BsonDocument> collection = db.GetCollection<BsonDocument>("foo");
    FilterDefinition<BsonDocument> filter = Builders<BsonDocument>.Filter.Empty;
    BsonDocument first = collection.Find(filter).FirstOrDefault();
}



 Comments   
Comment by Githook User [ 04/May/22 ]

Author:

{'name': 'Boris', 'email': 'boris.dogadov@mongodb.com', 'username': 'BorisDog'}

Message: CSHARP-4098: Include more detail when throwing PlatformNotSupportedException errors
Branch: v2.15.x
https://github.com/mongodb/mongo-csharp-driver/commit/4fd5fec0328a2c8d8453d43d10bd166b637e59b7

Comment by Githook User [ 25/Mar/22 ]

Author:

{'name': 'Boris', 'email': 'boris.dogadov@mongodb.com', 'username': 'BorisDog'}

Message: CSHARP-4098: Include more detail when throwing PlatformNotSupportedException errors
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/cb4dc265225461649627434fbd0fbac8e209df1e

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