Unable to use System.IO.Compression.FileSystem.dll

Question:

I am trying to get this Powershell code to work:

However I get the following error:

I have tried using the other DLL located here:

However I still get the same error.

How can I correctly import this library?

EDIT: I have tried all of the following, none of them worked:

Answer:

Turns out I was using an incorrect namespace.

ZipFile is located in the System.IO.Compression namespace, whereas the assembly is called System.IO.Compression.FileSystem.dll.

Ie. it had nothing to do with loading the assembly, I just need to use the correct namespace:

Source:

Unable to use System.IO.Compression.FileSystem.dll by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply