Why driver uses SharpCompress

MongoDb.DriverCore has dependency on SharpCompress. I wonder, why isn’t the built-in System.IO.Compression used instead?

The MongoDB wire protocol messages can be compressed with Snappy, zlib, or zstd compression. SharpCompress is used for zlib support. While System.IO.Compression does support zlib compression through ZLibStream, it was introduced in .NET 6. The .NET/C# Driver supports earlier versions (back to .NET Core 2.X and .NET Framework 4.7.2+). Thus we require SharpCompress for the broadest compatibility across our target frameworks. Once our minimum supported version is .NET 6, then we can consider removing SharpCompress in favour of System.IO.Compression.


Thanks, that makes sense

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.