DllNotFoundException: MonoPosixHelperSystem.IO.Compression.DeflateStream

Can anybody help out with this error? I'm not new to .net, but very new to Mono.

Full error message:

DllNotFoundException: MonoPosixHelper
System.IO.Compression.DeflateStream..ctor (System.IO.Stream compressedStream, CompressionMode mode, Boolean leaveOpen, Boolean gzip) 
(wrapper remoting-invoke-with-check) System.IO.Compression.DeflateStream:.ctor (System.IO.Stream,System.IO.Compression.CompressionMode,bool,bool)
System.IO.Compression.GZipStream..ctor (System.IO.Stream compressedStream, CompressionMode mode, Boolean leaveOpen) 
System.IO.Compression.GZipStream..ctor (System.IO.Stream compressedStream, CompressionMode mode) 
(wrapper remoting-invoke-with-check) System.IO.Compression.GZipStream:.ctor (System.IO.Stream,System.IO.Compression.CompressionMode)
Demeter.Zipper.Decompress (System.IO.Stream source, System.IO.Stream destination) 
Demeter.DataArchive.GetItemFromArchive[StringLibrary] (System.String folder, System.String fileName) [0x00000]
TestScript.Start ()   (at Assets\Scripts\TestScript.cs:29)

I'm definitely targeting Windows for my app and hoping to target Macs.

Here's my nifty Zipper class:

/// /// Simple stream compression utlity class /// Source: http://blogs.msdn.com/bclteam/archive/2005/06/15/429542.aspx ///

public static class Zipper
{
    /// <summary>
    /// Compress the source stream to the destination
    /// </summary>
    /// <param name="source"></param>
    /// <param name="destination"></param>
    public static void Compress(Stream source, Stream destination)
    {
        // We must explicitly close the output stream, or GZipStream will not
        // write the compression's footer to the file.  So we'll get a file, but
        // we won't be able to decompress it.  We'll get back 0 bytes.
        using (GZipStream output = new GZipStream(destination, CompressionMode.Compress))
        {
            Pump(source, output);
        }
    }

/// <summary>
/// Decompress the source stream to the destination
/// </summary>
/// <param name="source"></param>
/// <param name="destination"></param>
public static void Decompress(Stream source, Stream destination)
{
    using (GZipStream input = new GZipStream(source, CompressionMode.Decompress))
    {
        Pump(input, destination);
    }
}

/// <summary>
/// private buffer pumper to shove one stream into another
/// </summary>
/// <param name="input"></param>
/// <param name="output"></param>
private static void Pump(Stream input, Stream output)
{
    byte[] bytes = new byte[4096];
    int n;
    while ((n = input.Read(bytes, 0, bytes.Length)) != 0)
    {
        output.Write(bytes, 0, n);
    }
}

}

After further inspection, the reason for this failure is not so much the old mono version shipped with Unity 2.6.1, but rather that Mono implements System.IO.Compression.GZipStream not with a managed implementation, but it relies on a system installed zlib instead.

As it's not a good idea for Unity games to rely on the presence of zlib, it's a much safer idea to use a fully managed implementation instead.

If you have trouble getting a 3rd party managed implementation of compression to work, please open a new question, and I'll take a look at that too.

Searching the Unity forums, I found out that the version of mono used by Unity is out of date and the Unity team is working to update the engine with the newest mono libraries. This would solve this problem.

There are a couple immediate solutions. Some have reported that DotNetZip works with Unity. I keep receiving an "IBM437 codepage not supported" (or similar) error when trying to work with this library. It is a much better library than SharpZipLib from a usability perspective.

The article linked by drozzy has a mono compiled version of SharpZipLib, which seems like the way to go. I would prefer to use DotNetZip and not rely on a community-compiled version of a different library.

Thoughts?