c# – Why is ZipFile function not working?

Question:

I found a function on MSDN that I need to use for a program I'm doing. My problem is that when I try to use it, it appears as if it didn't exist in C# , remembering that I've already added using System.IO; to the top of my program. Do I need to make a reference to use it?

static void backup(string path)
{
    ZipFile.CreateFromDirectory(Directory.GetCurrentDirectory(), path);
}

Mistake:

Error CS0103 Name "ZipFile" does not exist in current context

Answer:

You need to add the System.IO.Compression.FileSystem reference to your project

Source: MSDN

Scroll to Top