Error 53: Could not load file or assembly

Nov 19, 2009 at 12:27 AM

Hi,

I am new to DotNetZip but it looks great and I am keen to use it in my current project.  I have a program that unpacks ZIP files and checks the contents.  I am using VB.NET 2008 and it works perfectly within the editor and when compiled on my development machine.  However I am unable to deploy it on the target computer.  When I run the app it fails with "Error 53: Could not load file or assembly 'ionic.zip.dll'.  The system cannot find the file specificied."

As far as I can tell I have referenced it correctly and set the Application Files Download Group for Ionic.Zip.dll to 'Required'.  I have also tried installing DotNetZip via the MSI on the target computer.  When I try to manually register ionic.zip.dll (using regsvr32) I get "Ionic.Zip was loaded, but the DLLRegisterServer entry point was not found"

Does anyone have any suggestion on what I could do to resolve this issue.  I appreciate any help you can give.

Richard

Coordinator
Nov 19, 2009 at 4:48 PM

I don't know, but i have some ideas, some things for you to check.

  1. The actual name is Ionic.Zip.dll, and I think (not sure) that case is important.  Check the references in your project to be sure they include the proper case.
  2. It could be that the file ionic.zip.dll is being corrupted. Check the size of the file on your development machine, compare against the deployment machine
  3. If you are writing a VB.NET app, you don't need to do regsvr32 .   Why are you doing that?  Are you using COM?
  4. I don't know what you mean by "Application Files Download Group".  What is that?   Is that something you do when you use ClickOnce deployment?

 

 

Nov 19, 2009 at 8:56 PM

Thanks Cheeso.

I have checked the case and believe it is okay.  The full Error message I am getting is:

"Error: 53 - Could not load file or assembly 'Ionic.Zip, Version=1.8.4.28, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c' or one of its dependencies. The system cannot find the file specified."  (Sorry, I should have posted this last time)

The file on the deployment machine seems fine so I dont believe it is corrupt.  I wonder if it is a path issue?

Using regsvr32 was one of the many things I tried, just in case.  This is only my third or forth vb.net app, my previous background is VB6.

The Application Files Download Group is a setting within the development environment which forces files to be deployed with a published application (instead of just relying on a pre-requisite file to have been deployed separately on the target machine.  I hope this makes sense.

Once thing that did occur to me over night, I am developing on a 64-bit Windows 7 machine so the DotNetZip files are installed in "C:\Program Files (x86)\" folder.  The deployment machine is 32 bit Windows 2003 server and the DotNetZip files are installed in C:\Program Files\ folder. Do you think this might be significant?  The app itself is 32-bit an runs fine (except for this issue). 

Thanks again for your help Cheeso

Coordinator
Nov 19, 2009 at 10:58 PM
Edited Nov 20, 2009 at 12:22 AM

sure, no problem .

Let's see - some basics.

normally when you build an VB.NET app , it produces an .exe file.  If your app also depends on a third-party library, like DotNetZip, then the .exe looks for the third party lib, at runtime.

You could do something similar with VB6, with OCX's and DLLs.  In vb6, the runtime looked in the PATH (environment variable) for third-party libraries.  Normally the path is set to a list of directories, often starting with c:\windows;c:\windows\system32\ and so on.  VB.NET also looks for third-party libraries at runtime, but it does not look in the PATH.  It looks in the installation directory for the .exe.  The idea is to avoid "DLL Hell" by requiring every app to independently install every DLL it references.  Suppose 2 apps use different versions of the same DLL.  With the VB.NET method, either app can update their DLL independently, without affecting the other.  (VB.NET also looks in a special location, called the Global Assembly Cache, or GAC, for 3rd party libs.  Ignore the GAC, it isn't relevant for your purposes).

So, on the deployment machine, you don't want the DotNetZip DLL (Ionic.Zip.dll) to be installed in "c:\program files\Whatever".   You want Ionic.Zip.dll to be present in the same directory where your .exe is installed.

I don't know how you deploy your app, but whatever you do with the EXE to copy it over to the target machine, you need to make sure the required DLL is in the same place, on the deployment computer.

you do not need to run regsvr32.  You do not need to install DotNetZip's MSI, although that won't hurt.  You just need the DLL as the EXE.

let me know how it goes.

 

Nov 19, 2009 at 11:39 PM

Hi Cheeso,

Thanks for your suggestions and clarifications.  It all makes sense and is now working correctly.

The VB.NET published deployment process (by default) buried the EXEs & support files in a ridiculous folder...

C:\Documents and Settings\Administrator\Local Settings\Apps\2.0\ZEHVDT2E.ETV\L148CHLN.J5T\mmli..tion_a6ea4e33dd371030_0001.0000_162a2446bb9f75df\

... so I had another copy of the EXE in a folder off the root (my app is called from our email filtering gateway).  As soon as I put the Ionic files in with the EXE it started working.

You have been very helpful, thanks.

Coordinator
Nov 20, 2009 at 12:22 AM

GREAT, glad it's working.

Good luck with VB.NET...