I'm kind of a newbie to Visual Studio programming.
I recently upgraded .Net 4.0 to 4.5 in order to use the ZipFile class under System.IO.Compression, but after the installation completed, Visual Studio (I'm using 2012) still cannot recognize ZipFile as a class name.
I've made sure that .Net 4.5 appears in Control Panel programs list and my C# solution sets .Net Framework 4 as the target framework.
Could someone help me figure this out?
string startPath = @"c:\example\start"; string zipPath = @"c:\example\result. zip"; string extractPath = @"c:\example\extract"; ZipFile. CreateFromDirectory(startPath, zipPath); ZipFile.
See ZipFile Class on MSDN. It shows the required framework version is 4.5. Once the framework version is fixed check you have added a reference to the System.IO.Compression.FileSystem.dll
assembly and added a using System.IO.Compression
directive to your class.
You also need to reference the System.IO.Compression.FileSystem.dll assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With