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

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

Step 1: SetLibraryPath

Add a call to SetLibraryPath before you init SevenZipExtractor.

1
2
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.

Jon

Share