是否可以将自定义SSIS组件安装到除GAC之外的其他位置?我需要将自定义SSIS组件部署到SSIS服务器,但我可能无法访问该服务器上的GAC。我想知道除了安装到GAC之外,是否还有其他方法?我知道在使用第三方DLL与脚本任务或脚本组件时有一种方法,但不确定是否有方法与SSIS自定义组件一起使用。
谢谢!
发布于 2020-11-23 15:07:49
您可以使用manually load来反射dll。
请参见下面的示例,您可以将这两个方法添加到您的脚本任务中。
static ScriptMain()
{
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
}
static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
if (args.Name.Contains("BouncyCastle.Crypto"))
{
string path = "C:\\SO\\bouncycastle\\";
return System.Reflection.Assembly.LoadFile(System.IO.Path.Combine(path, "BouncyCastle.Crypto.dll"));
}
return null;
}

您还需要在脚本任务中引用dll

https://stackoverflow.com/questions/64864809
复制相似问题