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

Jul 16, 2009 at 4:57 PM

I may just be being incredibly dim today, but I am getting the following error when using DotNetZip in my VB project.

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

I have downloaded the msi, installled the software and added a reference to the DLLs in my project.

Then when I copied the code from the samples page I got the error. What am I doing wrong?

Thanks.

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

Coordinator
Jul 16, 2009 at 8:21 PM

I don't know why that's happening, there must be something else in your project that is conflicting.

it may help if you fully qualify the ZipFile class:  Ionic.Zip.Zipfile. 

Also, insure you are using the latest DotNetZip.

Jul 17, 2009 at 2:33 PM

I did try the fully qualified path and I am still getting the same ambiguity.

I downloaded the latest version from the site yesterday afternoon.

Still stumped! :(

Jul 17, 2009 at 2:42 PM

SOLVED! When I checked the project references I had references to Ionic.Zip and Ionic.Zip.Partial. I removed the reference to Ionic.Zip.Parial and it now works.

Coordinator
Jul 17, 2009 at 6:09 PM

Great, glad to hear it.  Since you have the Partial dll, I guess you have the source distribution.  That's really just an intermediate build output.

Glad you've got it working now.