SQLTeam.com | Weblogs | Forums

Unzip password proteced files - SSDS - .net 4.5


I have started using the dotnetzip ...

Downloaded it and in ssis script task referencing Ionic.ZIP.dll

in script, I am using using Ionic.ZIP and then in the main:
public void Main()
string zipFullPath = Dts.Variables["User::FileNameFullPathZIP"].Value.ToString();
string zipFullPath_Input = Dts.Variables["User::FileNamePathZIP_Input"].Value.ToString();
string zipPassword = Dts.Variables["User::Password"].Value.ToString();

        // extract all files into 
        using (var zip = ZipFile.Read(zipFullPath))
            zip.Password = zipPassword;

        Dts.TaskResult = (int)ScriptResults.Success;

but I get the following error:

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()


you might want to post here