Jon Gallant

Solution to the exception: Can not load 7-zip library or internal COM error! Message: DLL file does not exist.

1 min read

Here’s how to solve the exception: “Can not load 7-zip library or internal COM error! Message: DLL file does not exist.”

1513.image 5F00 thumb 5F00 18F8D605

Step 1: SetLibraryPath

Add a call to SetLibraryPath before you init SevenZipExtractor.

SevenZipExtractor.SetLibraryPath(@"C:\Program Files\7-Zip\7z.dll");
SevenZipExtractor zip = new SevenZipExtractor(file);zip.ExtractArchive(xsnFolder.FullName);

Step 2: Set Platform Target

Also make sure that your project Platform target is set to Any CPU.

Screenshot

Jon

Share:
Share on X