Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4098

Include more detail when throwing PlatformNotSupportedException errors

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.15.1
    • None
    • None
    • None

    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();
      }
      

      Attachments

        Activity

          People

            boris.dogadov@mongodb.com Boris Dogadov
            alex.bevilacqua@mongodb.com Alex Bevilacqua
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: