Reading dll on Windows Server 2008 (64-bit)

Jan 21, 2011 at 8:21 PM


We just lost a server and have xferred our website from Win Server 2003 to a new machine using Win Server 2008 64-bit. Now my DotNetZip does not work. I've tried using the recommendations in, specifically I ran the MSI, used the gacutil, and tried 4 different regasms (the 2.0 and 4.0 versions in both Framework and Framework64) but with no luck. All regasms say that types were registered successfully. I have verified that the entries have values in the registry as indicated by another thread (Id=62831), although mine is different from both listed there, {EBC25CF6-9120-4283-B972-0E5520D00005}.

In VS 2008, no errors are shown in the code, so all seems fine, but when the website opens, I get "Compiler Error Message: BC30002: Type 'Ionic.Zip.ZipFile' is not defined."

In the Detailed Compiler Output, I'm told that the "Namespace or type specified in the Inports 'Ionic.Zip' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member."

Is there something I'm missing or need to check for? Any thoughts or recommendations?



Jan 31, 2011 at 1:59 PM

It's hard to give a specific answer, but I'd recommend that you break the problem down into smaller parts, to isolate and diagnose the problem.

You mentioned regasm and gacutil.  Regasm is necessary ONLY if you need COM access to the DotNetZip library.   If you have VBScript, Javascript, Perl, Python, or some other scripting environment (other than Powershell), or VB6, then you may need to run regasm.  If you write your apps in a .NET language, then you don't need to run regasm.  I'm guessing you are using VB.NET, because that error message you posted looks like something that would come from the VB.NET compiler.   If that's true, you don't need to worry about regasm.  Having run regasm won't affect any .NET apps you write.  It's irrelevant.  I don't think we need to even discuss the GUIDs and whether they match.  

Ok, now onto gacutil. You only need gacutil if you are using regasm.  This isn't strictly true, in all cases, but it holds true in the vast majority of cases, both for DotNetZip and other .NET libraries.  If you are not absolutely certain that you need gacutil, then you probably don't need it.  So, rule that out as a possibility as well.

That takes care of the possible solutions you tried.  Now, onto the specific problem symptoms you provided. You said you get an error message when running the app. 

This is a simple one - in most cases to resolve that sort of error ("Type XXX is not defined" and "Namespace xxx doesn't contain any public methods or cannot be found") you need to add the DotNetZip library, into the bin directory of your ASPNET app.  Just copy Ionic.Zip.dll into the \bin dir for your particular application directory.  Then press F5 in the browser with the webpage open, and it should work just fine.

let me know if that doesn't work.


Feb 2, 2011 at 2:39 PM
Edited Feb 2, 2011 at 2:40 PM

Thanks for the reply, although this is a little embarrassing.

The "website" that I lost DotNetZip usage on was actually within another website, which is to say that the pages I was using it on were in a folder that was set up in IIS as a virtual directory within another website. I don't recall why I set it up this way in the first place, although I'm pretty sure it was largely based on some ignorance(s) on my part and the desire to use "open website" in VS without getting the whole root site. It was realized on Monday that the dll was being used successfully on another of our servers that had WS2008 running on it, and I tried using the dll on a desktop app and that was successful. So the issue was almost definitely the folder or the website, e.g. permissions or something. I played with those with no success and on a whim I copied the dll from the original bin folder of my "website" to the bin folder of the website root and suddenly it worked. After monkeying with a couple other things that weren't working quite right, I slowly remembered the way I had set up that folder and when I moved the web.config contents of the "website" to the root web.config, all my other problems went away. So, while the folder structure had been moved to the new server correctly, the virtual directory setting had been missed by all and the memory of it took a while to come back to me. I was even able to delete the bin folder and web.config from the ex-virtual folder and just keep the ones at the root. (I hope none of this makes you say "duh!")

As for your reply, that's even more info (about gacutil and regasm), or at least more succinct, than I had put together before so it is much appreciated. I should have been explicit that the dll was in my bin folder to begin with, although obviously that didn't help in my case because of web.config(?) or some artifact setting due to the original folder construction in IIS.

Thanks for your efforts and the library.


Feb 2, 2011 at 5:57 PM

Kevin, No problem, I've been there, we all have, I guess.  I hope my reply was somewhat helpful. I'm glad you figured it all out.