Skip to content

Throwing 'dll not found' exception when using in .NET Core 2.2 Console app. #18

@mikemac8888

Description

@mikemac8888

Zstandard.Net 1.1.7
.net core 2.2

Folders x64 and x86 are added within the bin folder and each contain libzstd.dll. But for some reason I keep getting error:

Exception has occurred: CLR/System.DllNotFoundException
An exception of type 'System.DllNotFoundException' occurred in Zstandard.Net.dll but was not handled in user code: 'Unable to load DLL 'libzstd' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)'

class Extensions {
    public static byte[] Compress(byte[] data)
    {
        using (var memoryStream = new MemoryStream())
        using (var compressionStream = new ZstandardStream(memoryStream, CompressionMode.Compress))
        {
            compressionStream.Write(data, 0, data.Length);
            compressionStream.Close();
            return memoryStream.ToArray();
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions