I have an SSIS package that uses a script task to populate a datatable with data from a variety of different file types including excel.
I am using NPOI to read in t
static ScriptMain()
{
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
}
static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
//(string)Dts.Variables["User::CustomDLL"].Value;
if (args.Name.Contains("HtmlAgilityPack"))
{
string path = @"C:\Temp\";
return System.Reflection.Assembly.LoadFile(System.IO.Path.Combine(path, "HtmlAgilityPack.dll"));
//return System.Reflection.Assembly.UnsafeLoadFrom(System.IO.Path.Combine(path, "HtmlAgilityPack.dll"));
}
return null;
}