Installing DotNetZip

Sep 10, 2009 at 5:15 PM

Hello,

this is a question from a novice so please be patient. I downloaded the DotNetZip, but how do I get it to work within my VB.NET code ?

I used the code example below, but it is not recognizing the DotNetZip functions. Somehow I need to add a dll, but looking thru the downloaded files, I don't see an dll's.

Thanks for any help !

cheers!

Using zip As ZipFile = New ZipFile()
         zip.AddFile("c:\photos\personal\7440-N49th.png")
         zip.AddFile("c:\Desktop\2005_Annual_Report.pdf")
         zip.AddFile("ReadMe.txt")
         zip.Save("MyZipFile.zip")
     End Using

Coordinator
Sep 10, 2009 at 6:12 PM

What did you download?  there are 5 or 6 downloads.  One is source code, some of them are binary releases, one is documentation.  which thing did you download?  If you are building apps you probably want the Devkit download.  This is all explained on the downloads page.

After you get the DLL, you need to add a reference to the DLL in your project.  Do you know how to do that?

Sep 10, 2009 at 7:11 PM

Hi Cheeso, thanks for your reply !

I downloaded "DotNetZip-src-v1[1].8.4.22.zip". That is NOT it ? Let me look for the Devkit. 

I do know how to add a reference.

thanks!

Coordinator
Sep 10, 2009 at 7:27 PM

You don't want the src download.  That is source code, useful only if you plan to modify and re-build the DotNetZip library yourself.   Most people don't do this. Especially novices.

If you just want to use DotNetZip, get the devKit.

 

Sep 10, 2009 at 7:55 PM

Hi Cheeso, thanks again !

I downloaded the right file, referenced all the DLLs but I still get an error in my code for the line:

<font size="2" color="#0000ff"><font size="2" color="#0000ff">

Using

</font></font><font size="2" color="#0000ff">

 

</font>

zip As ZipFile = New ZipFile

Error 1 Type 'ZipFile' is not defined. 

Any idea ?

Coordinator
Sep 10, 2009 at 9:44 PM

Yes, I think you need a statement like this at the top of your file:

Imports Ionic.Zip

Sep 10, 2009 at 9:52 PM

Hmm, that got rid of the "Type is not defined" error, but came back with this error:

Error 2 'ZipFile' is ambiguous in the namespace 'Ionic.Zip'. 

 

Coordinator
Sep 10, 2009 at 10:21 PM

I don't know why that error message would come up.

I did a quick search and got no joy.

I can suggest that you remove the reference to Ionic.Zip.dll (The one you just added).

then rebuild (F5).  This will fail.

then re-add the reference.  Then rebuild (F5 again).  This may work.

Sep 10, 2009 at 10:55 PM

Cheeso,

my bad. I added two different Ionic DLLs. I removed one, now I get no errors ! ;)

Thank you very much for all your help !