Why is the ZipFile function not working?

3

I found a function in 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 did not exist in C # , reminding me that I already added using System.IO; to the top of my program. Do I need to make any reference to use it?

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

Error:

  

Error CS0103 The name "ZipFile" does not exist in the current context

    
asked by anonymous 09.06.2017 / 14:12

1 answer

2

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

Source: MSDN

    
09.06.2017 / 14:18