I didn't find ZipFile class in the System.IO.Compression namespace
You need an extra reference for this; the most convenient way to do this is via the NuGet package System.IO.Compression.ZipFile
<!-- Version here correct at time of writing, but please check for latest -->
<PackageReference Include="System.IO.Compression.ZipFile" Version="4.3.0" />
If you are working on .NET Framework without NuGet, you need to add a dll reference to the assembly, "System.IO.Compression.FileSystem.dll" - and ensure you are using at least .NET 4.5 (since it doesn't exist in earlier frameworks).
For info, you can find the assembly and .NET version(s) from MSDN
Getting error on System.IO.Compression when trying to use ZipFile class
I solved it. The problem is that it is not enough to only add System.IO.Compression
to references, you must also add System.IO.Compression.Filesystem
The name 'ZipFile' does not exist in the current context when including System.IO.Compression
Have you tried adding the namespace to your current file? To do this add this to the top of the file.
using System.IO.Compression;
Cannot use System.IO.Compression.FileSystem even though it's referenced but won't include
The issue was that my Handler wasn't created for that project. I ended up creating a new handler for that project and I got access to everything within my References folder.
Adding System.IO.Compression assembly to Mono on CentOS 7
I had a similiar problem and found the solution in the question I didn't find "ZipFile" class in the "System.IO.Compression" namespace
The Solution is to a a reference to System.IO.Compression.FileSystem.dll
eg. mcs /reference:System.IO.Compression.FileSystem.dll Main.cs
char extraction issue with ZipFile (System.IO.Compression), c# (WPF)
Windows don't behave nicely with unicode file names inside zip.
Using the Enconding 850 solves the problem.
Encoding.GetEncoding(850);
It looks like it got fixed in .Net framework 4.8 but I can't test it right now.
Sources:
https://devblogs.microsoft.com/oldnewthing/20180515-00/?p=98755
http://archives.miloush.net/michkap/archive/2012/01/04/10252916.html
Related Topics
What Is the Fastest Way to Combine Two Xml Files into One
C# How to Wait for a Webpage to Finish Loading Before Continuing
Is It Appropriate to Extend Control to Provide Consistently Safe Invoke/Begininvoke Functionality
JSON String to CSV and CSV to JSON Conversion in C#
How to Read All Files Inside Particular Folder
Find Nth Occurrence of a Character in a String
Creating Delegates Manually VS Using Action/Func Delegates
Directory.Getfiles of Certain Extension
Alternatives to Thread.Sleep()
Could Not Load File or Assembly 'Microsoft.Reportviewer.Common, Version=11.0.0.0
Multiple Colors in a C# .Net Label
How to Use Xpath with Xdocument
Cancelling a Task Is Throwing an Exception