I've made myself a very simple package as a proof of concept. It calls a script task to unzip all the contents of a zip file. I've hard-coded the values for source zip and target directory.
The task fails with this (to me) very unhelpful error message.
I'm not a C# programmer so I just copied the code from a page I now can't find.
This is my code:
#region Help: Introduction to the script task
/* The Script Task allows you to perform virtually any operation that can be accomplished in
* a .Net application within the context of an Integration Services control flow.
*
* Expand the other regions which have "Help" prefixes for examples of specific ways to use
* Integration Services features within this script task. */
#endregion
#region Namespaces
using System.IO.Compression;
#endregion
namespace ST_7705c64ac5b442f6bd8a15993d3d2168
{
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
public void Main()
{
string zipFilename = "\\<server name>\\MBSMIS\\Transfers\\IN\\Exonet\\Statements\\Statements.zip";
string targetDirectory = "\\<server name>\\MBSMIS\\Transfers\\IN\\Exonet\\Statements\\my-output-folder";
ZipFile.ExtractToDirectory(zipFilename, targetDirectory);
Dts.TaskResult = (int)ScriptResults.Success;
}
#region ScriptResults declaration
enum ScriptResults
{
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
};
#endregion
}
}
I have included a reference to System.IO.Compression.FileSystem which is probably a given as I don't think it compiles without that.
I've checked things like making sure the strings have the correct path and file-name and that the archive is not open anywhere else.
Is there a method of getting more helpful information out of the error or does that mean something to people more familiar with C#?