How to zip a folder using vb.net and in .net framework 4.0. I am able to do this by using ZipFile class which is available in framework 4.5 but I need to use only framework 4.0 and also no third party library. Please help
Actually you can use the ZipFile
class in .NET 4.0 as well. You just gotta add a reference to the System.IO.Compression.FileSystem.dll
file, located in:
%SystemRoot%\Microsoft.NET\assembly\GAC_MSIL\System.IO.Compression.FileSystem\v4.0_4.0.0.0__b77a5c561934e089\System.IO.Compression.FileSystem.dll
As you see it is located in the "v4.0" folder, so it exists in .NET 4.0, but for some reason isn't referenced automatically.
To add a reference to your project:
Right-click the project node in the Solution Explorer
.
(Image credit: another Stack Overflow question)
Press Add Reference...
.
Go to the Browse
tab and locate the file mentioned above.
How to: Add or Remove References By Using the Add Reference Dialog Box
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