I'm trying to use the features included within ZipFile
but cannot get the namespace to include. I have a project and have referenced System.IO.Compression
successfully but when trying to reference System.IO.Compression.FileSystem
I get:
The type of namespace name 'FileSystem' does not exist in the namespace 'System.IO.Compression'
When I try to call ZipFile
I get
The name 'ZipFile does not exist in the current context
I'm running .net 4.5.2
so I should have access to these functions. I don't know what's going on because it seems I'm doing everything correctly.
I've tried adding both references with Add Reference
within Visual Studio which includes it within the References
folder but I cannot use it within my handler.
Any help would be great, thanks!
My Using Directive currently:
using System.IO.Compression;
I am referencing the System.IO.Compression.FileSystem.dll
within my project as well so this error is not making any sense.
Trying to use ZipFile:
string startPath = @"c:\example\start";
string zipPath = @"c:\example\result.zip";
string extractPath = @"c:\example\extract";
ZipFile.CreateFromDirectory(startPath, zipPath);
ZipFile.ExtractToDirectory(zipPath, extractPath);
The directories within the variables don't exist but that doesn't matter because ZipFile isn't even being found.
Using Directives:
My Project and References: