I want to use ZipFile class but can't figure out how to add namespace properly.
ZipFile.CreateFromDirectory(startPath, zipPath);
ZipFile.ExtractToDirectory(zipPath, extractPath);
gives
ErrorCS0117 'ZipFile' does not contain a definition for 'CreateFromDirectory'
ErrorCS0117 'ZipFile' does not contain a definition for 'ExtractToDirectory'
I have added the
using System.IO;
using System.IO.Compression;
using System.IO.Compression.FileSystem;
which results in
Error CS0234 The type or namespace name 'FileSystem' does not exist in the namespace 'System.IO.Compression;
added the assembly references to
System.IO.Compression
Assembly System.IO.Compression
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.IO.Compression.dll
System.IO.Compression.FileSystem
Assembly System.IO.Compression.FileSystem
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.IO.Compression.FileSystem.dll
tried to install/uninstall packages with NuGet. Rebuild, even restart the PC.
Nothing seems to be working. The current version of .Net in VS is 4.7
