我在Foreach循环容器中有一个脚本任务来遍历每个.zip文件并将其解压缩到保留文件夹中。在脚本任务中,我有这个代码来解压缩文件
public void Main()
{
string zipfullpath = Dts.Variables["User::ZipFullPath"].Value.ToString();
string inputfolder = Dts.Variables["$Package::DownloadDirectory"].Value.ToString();
using (ZipArchive arch = ZipFile.OpenRead(zipfullpath))
{
foreach (ZipArchiveEntry entry in arch.Entries)
{
entry.ExtractToFile(Path.Combine(inputfolder, entry.FullName));
}
}
Dts.TaskResult = (int)ScriptResults.Success;
}
然而,当我运行容器时,我有这个错误
at System.RuntimeMethodHandle.InvokeMethod(Object target,Object [] 参数,签名sig,布尔构造函数)at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object []参数,Object []参数)at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,Object []参数,CultureInfo文化)
在System.RuntimeType.InvokeMember(String name,BindingFlags bindingFlags,Binder binder,Object target,Object [] providedArgs, ParameterModifier []修饰符,CultureInfo文化,String [] namedParams)at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
我认为它与连接有关?