How to fix error "Ionic.Zip.dll cannot be found or loaded"?

Topics: fixed
Oct 22, 2012 at 7:53 PM

When I run the script I get the following,

"Cannot continue if Ionic.Zip.dll cannot be found or loaded..."

The Ionic.Zip.dll is in the same folder as the script along with a couple of recently recorded .wtv files.  Any help would be appreciated.  I apologize if this was covered anywhere else.  I tried multiple searches.

Coordinator
Oct 23, 2012 at 1:05 PM

Hi

Can you please provide the full command you are using to run the script?

Also, from PowerShell, can you please go to the directory containing the script and run this command:

Get-Location -PSProvider FileSystem

and provide the output?

Please also provide the output from "dir".

Thanks.

Philip

 

Oct 24, 2012 at 10:45 PM
Below is a copy/paste from my Powershell window with the items requested:
PS C:\users\public\recorded tv\v0.17> Get-Location -PSProvider FileSystem

Path
----
C:\users\public\recorded tv\v0.17


PS C:\users\public\recorded tv\v0.17> dir


Directory: C:\users\public\recorded tv\v0.17


Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 10/22/2012 2:14 PM XML
-a--- 10/22/2012 2:14 PM 462336 Ionic.Zip.dll
-a--- 10/22/2012 4:17 PM 5414 Log_20121022161728.txt
-a--- 10/22/2012 2:56 PM 3026452480 The Middle_WFAADT_2012_10_03_18_59_00.wtv
-a--- 10/22/2012 2:56 PM 2926837760 The Middle_WFAA_2012_09_26_18_59_30.wtv
-a--- 10/22/2012 2:14 PM 646190 WTV-MetaRenamer.pdf
-a--- 10/22/2012 2:14 PM 121370 WTV-MetaRenamer.ps1
-a--- 10/22/2012 2:14 PM 1889 WTV-MetaRenamer.xml


PS C:\users\public\recorded tv\v0.17> ./wtv-metarenamer.ps1
Cannot continue if Ionic.Zip.dll cannot be found or loaded
At C:\users\public\recorded tv\v0.17\WTV-MetaRenamer.ps1:2755 char:5
+ Throw "Cannot continue if Ionic.Zip.dll cannot be found or loaded"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Cannot continue...found or loaded:String) [], RuntimeException
+ FullyQualifiedErrorId : Cannot continue if Ionic.Zip.dll cannot be found or loaded

PS C:\users\public\recorded tv\v0.17>



Thanks for your help,
Don
On Tue, Oct 23, 2012 at 8:05 AM, pcolmer <notifications@codeplex.com> wrote:

From: pcolmer

Hi

Can you please provide the full command you are using to run the script?

Also, from PowerShell, can you please go to the directory containing the script and run this command:

Get-Location -PSProvider FileSystem

and provide the output?

Please also provide the output from "dir".

Thanks.

Philip

Read the full discussion online.

To add a post to this discussion, reply to this email (wtvmetarenamer@discussions.codeplex.com)

To start a new discussion for this project, email wtvmetarenamer@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Oct 25, 2012 at 2:53 PM

Please make sure that you have right-clicked on the DLL, choose Properties and clicked on Unblock. It isn't in the documentation and seems to be a recent requirement.

Thanks.

Philip

 

Dec 2, 2012 at 2:24 AM
Edited Dec 2, 2012 at 2:34 AM

Hi Philip, I'm getting

PS E:\Recorded TV> ./wtv-metarenamer.ps1
Cannot continue if Ionic.Zip.dll cannot be found or loaded
At E:\Recorded TV\WTV-MetaRenamer.ps1:2756 char:10
+     Throw <<<<  "Cannot continue if Ionic.Zip.dll cannot be found or loaded "
    + CategoryInfo          : OperationStopped: (Cannot continue...ound or loaded :String) [], RuntimeException
    + FullyQualifiedErrorId : Cannot continue if Ionic.Zip.dll cannot be found or loaded

now and I'm pretty clueless how to fix it but loved your script while it was working.

I had it running fine on another drive and i copied the Recorded TV folder to the new drive and unblocked the DLL and wtv-metarenamer.ps1 after trying a fresh install too.

I also noticed when googling the error that i had installed <cite>www.mediacentermaster.com/ </cite>

that also uses Ionic.Zip.dll and i even uninstalled that app. I searched the registry for Ionic.Zip.dll but didnt find a entry.

the only other thing is i ran spybot search and destroy recently but i checked the logs and there was no mention of the dll.

 

FYI

OS Win7

PS E:\Recorded TV> Get-Location -PSProvider FileSystem

Path
----
E:\Recorded TV

 

Thanks in advance for any help resolving the problem and all your hard work

Paul

Dec 2, 2012 at 3:04 AM

WOW a little more head bashing solved the problem i deleted everything (logs, rename files, xml...) and reinstalled everything from the zip into the same DIR but it still didnt work but after opening a new powershell window IT WORKS AGAIN man what a bunch of !$SA##

 

Thanks for this awesome script!!!

Paul

Coordinator
Dec 2, 2012 at 7:41 AM

That was a strange one but I'm glad you managed to get it working.

Also glad to hear you like the script.

Philip

 

May 19, 2013 at 2:49 AM
First of all, this is a great and useful script. Thank you for writing it! I was not able to get the script to run with a path name from another directory. I have years worth of .wtv files with the original names on my network. I have moved them manually into trees based on series name and season. I did not want to have to copy the script zip into each directory every time I wanted to rename the wtv files with SxxExx format. I put the renamer script in a directory and tried to run the script with a pathname. It would always complain about not being able to find the included dll. I looked at the script and I think I know how to fix this. I have just hacked the script for now, because I would like the author to review it and possibly include it as an update. Here's what I found:
There is a variable in the script called "$i_am_here". This variable is used to have store the current directory being used in Powershell. If you are trying to run the script from a different directory (where the script is not present), then $i_am_here points to the wrong directory. It points to where the files are. Later in the script, when it looks for the dll it uses this variable and cannot find the dll because it points to the CURRENT directory, not the one with the script. I broke up the $i_am_here variable into two new variables: "$scripts_are_here" and "$recordings are here":
#$i_am_here = $(Get-Location -PSProvider FileSystem)
#(The folder where I store the wtvmetarenamer script is C:\WMR)
$script_is_here = "C:\WMR"
$recording_is_here = $(Get-Location -PSProvider FileSystem)
Then I searched for "i_am_here" and replaced it with the correct variable above:

line 1052:
 $configurationfile = "$script_is_here\WTV-MetaRenamer.xml"
line 1089:
# Define the default result
# Default location where the script is caching data
$result = "$script_is_here\XML"

line 2754:

The DLL is expected to be located in the same folder as this PowerShell script.

try
{
Add-Type -Path "$script_is_here\Ionic.Zip.dll"
}

line 1108:
# Define the default result
# Default location where the script should be looking for recordings - the same directory as where the script is running from
$result = "$recording_is_here"

It works for me now. I can go to any directory with .wtv files, and run c:\wmr\wtv-metarenamer.ps1 .
I would suggest that one way to do this is to pass the "c:\wmr" parameter on the CLI and use that to populate the $script_is_here variable. Alternately, one could put it in the xml config file, or hard code it as above.

Anyone who has struggled with this, please give it a try and post if it works for you.

Thanks,
Dean
May 31, 2013 at 4:52 PM
I've been held prisoner by the "Ionic.Zip.dll cannot be found..." problem... intermittently! I've just figured out WHY and I don't think it's addressed above, though I can't guess how many would experience this:

My test area for this lovely program is "E:\X". A simple enough name. This being Windows 8, not the more restrictive UNIX I was raised with, I often "cd \x" instead of "cd \X": Windows doesn't care about a little thing like upper-/lower-case in a File/Folder name.

So I run PowerShell (typically as Admin while testing), then "E:" and "cd \x".

But... you get the bleedin' "Ionic.Zip.dll cannot be found" error when the case of the Folder name ain't precise!!! 'Cost me hours of time, and I only noticed it by "luck". I'm "in" the "X" Folder, with all the script files present, but the script can't cope with its perceived path element being "x" instead of "X".

If I "cd \X", precisely matching the Folder name, WTV-MetaRenamer runs sanely; otherwise... sigh.
Coordinator
Jun 1, 2013 at 2:52 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.