SSIS Script Task Error

Jul 8, 2009 at 5:59 PM

I'm on a 64-bit OS, designing an SSIS package. I got the latest DotNetZip DevKit and unzipped it.

Created a new package with a Script Task and added reference to Ionic.Zip. Intellisense worked perfectly fine and I wrote code to Zip a file. I was able to compile this successfully.

However I'm getting this error when I run the package. Need help to resolve the following error:

 

SSIS package "Package2 (1).dtsx" starting.
Error: 0x1 at Script Task: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Ionic.Zip, Version=1.8.4.5, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c' or one of its dependencies. The system cannot find the file specified.
File name: 'Ionic.Zip, Version=1.8.4.5, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c'
   at ST_2d69cc45ee9144388f402c7fe5ec7e69.csproj.ScriptMain.Main()

SSIS package "Package2 (1).dtsx" starting.

Error: 0x1 at Script Task: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Ionic.Zip, Version=1.8.4.5, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c' or one of its dependencies. The system cannot find the file specified.

File name: 'Ionic.Zip, Version=1.8.4.5, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c'

   at ST_2d69cc45ee9144388f402c7fe5ec7e69.csproj.ScriptMain.Main()

 

Coordinator
Jul 8, 2009 at 7:05 PM
Edited Jul 8, 2009 at 7:19 PM

This seems like an SSIS question, not a DotNetZip question.  Your package is not able to resolve the referenced assembly (DotNetZip).  I don't know SSIS, so I cannot help you.  But I'm sure someone out there can suggest where or how you  need to deploy a third-party DLL in order to be loaded by SSIS.  You might think about putting it into the GAC. 

Jul 22, 2010 at 4:05 PM

try copying the dll

to C:\Program Files\Microsoft SQL Server\100\DTS\Binn

Aug 3, 2011 at 4:59 PM

i'm having exactly the same problem. How did you resolve it?

i tried copying the dll to DTS folder, and didn't work.

thanks in advance

Coordinator
Aug 3, 2011 at 8:53 PM

Did you try putting it into the GAC?  (Do you know what that means? ) 

did you try putting it into the SQL Server binn directory as suggested by GCodePlex ?

 

Aug 4, 2011 at 8:43 AM

Yes, I tried the two options, GAC and DTS folder, as suggested by GCodePlex, and didn't work. Also I copied the DLL into SQL bin folders, but with the same result.

The problem seems to be relationated with the SQL Agent, because with the DTS tool it works fine.

Coordinator
Aug 4, 2011 at 1:22 PM

I am baffled that it still fails with an assembly load error, even with the Ionic.Zip.dll assembly installed into the GAC.

From what I understand about .NET, that would be impossible.  Are you sure you are getting that error?  Post the exact error message that you see.

 

 

Aug 4, 2011 at 2:52 PM

Ok, this is the error that appears on the event viewer (sorry, but it's in spanish):

 

 Utilidad de ejecución de paquetes de Microsoft (R) SQL Server  Version 10.0.4000.0 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. Reservados todos los derechos.    Iniciado: 14:05:55  Error: 2011-08-04 14:05:57.23     Código: 0x00000001     Origen: Descomprimir ficheros ZIP      Descripción: System.Reflection.TargetInvocationException: Se produjo una excepción en el destino de la invocación. ---> System.IO.FileNotFoundException: No se puede cargar el archivo o ensamblado 'Ionic.Zip, Version=1.9.1.6, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c' ni una de sus dependencias. El sistema no puede encontrar el archivo especificado.  Nombre de archivo: 'Ionic.Zip, Version=1.9.1.6, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c'     en ST_172dc6a5acdf46758456785b590b4348.csproj.ScriptMain.Main()    AVS: El registro del enlace de ensamblado está desactivado.  Para habilitar el registro de errores del enlace de ensamblado, establezca el valor de Registro [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) como 1.  Nota: existe una disminución del rendimiento asociada registro de errores del enlace de ensamblado.  Para desactivar esta característica, elimine el valor de Registro [HKLM\Software\Microsoft\Fusion!EnableLog].       --- Fin del seguimiento de la pila de la excepción interna ---     en System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)     en System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)     en System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)     en System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)     en Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()  Fin de error  DTExec: la ejecución del paquete devolvió DTSER_FAILURE (1).  Iniciado: 14:05:55  Finalizado: 14:05:57  Transcurrido:  1.373 segundos.  Error de ejecución del paquete.  No se pudo realizar el paso.

 

Basically shows that the system can not find the file specified.

 

 

Coordinator
Aug 4, 2011 at 3:23 PM

yes, very clear.  Windows cannot find the Ionic.Zip assembly.

and have you double-verified that Ionic.Zip (v1.9.1.6) is present in the GAC?   Can you post a snip of the following command:  %WINSDK%\bin\gacutil -l | findstr Ionic  ? 

(where %WINSDK% is replaced with the directory into which you have installed the Windows SDK)

Either that, or, post a screenshot of Windows Explorer when it is open to %Windir%\Assembly ,  and scrolled to the Ionic.Zip assembly.

 

Aug 4, 2011 at 3:35 PM

aaaaarggghhhh!!!! Sorry, sorry, sorry, I found the error... I have a cluster with two nodes, and the library wasn't installed correctly in one of the nodes, the node that actually is the owner of the SQL instance. I reinstalled the dll with gacutil on that node, and now it works fine.

Thanks a lot for your replies.

thanks!

Coordinator
Aug 4, 2011 at 8:56 PM

no problem.  I figured it was a bad assumption somewhere.  If the .NET assembly is in the GAC, as far as I know, you will never get the "FileNotFoundException" on that assembly.