Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net Issue trying to unzip folder

Hi
I am trying to unzip a folder using the code example below
I am pretty sure that I have .NET 4.5 installed on my machine
but it still doesn't recognize ZipFile
 I tried to add a reference to Imports System.IO.Compression
but can't find it.
I can see it in the bottom box in the attached image
Not sure what to do

Imports System.IO
Imports System.IO.Compression

Module Module1

    Sub Main()
        Dim startPath As String = "c:\example\start"
        Dim zipPath As String = "c:\example\result.zip"
        Dim extractPath As String = "c:\example\extract"

        ZipFile.CreateFromDirectory(startPath, zipPath)

        ZipFile.ExtractToDirectory(zipPath, extractPath)
    End Sub

End Module

User generated image
Avatar of Kamal Khaleefa
Kamal Khaleefa
Flag of Kuwait image

try to Add a reference to this assembly: System.IO.Compression.FileSystem
Avatar of Lokesh B R
Hi,

Add the Reference to System.IO.Compression.FileSystem

1. Right click on the References
2. Add References
3. Select System.IO.Compression.FileSystem
4 Click Ok
Avatar of Murray Brown

ASKER

As I said in my question " I tried to add a reference to Imports System.IO.Compression
 but can't find it."
What could cause this?
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great answer. As always! Thanks
Not a problem murbro, glad to help.