将 SQL Server 2016 (13.0.15000.23) 和 SSIS 与带有最新 SSDT 的 VS 2015 社区一起使用,我有一个带有 1 个脚本任务的简单 SSIS 测试包。在该任务中,我只是添加了对 Renci.sshnet (2014.4.6.0) 的引用,它是一个 .NET 4.0 DLL。
我把项目目标框架改成4.0就可以基本调用创建连接了:
Console.WriteLine("Start");
Renci.SshNet.ConnectionInfo ConnNfo = new
Renci.SshNet.ConnectionInfo("hostOrIP", 22, "username",
new AuthenticationMethod[]{
// Pasword based Authentication
new PasswordAuthenticationMethod("username","password"),
// Key Based Authentication (using keys in OpenSSH Format)
new PrivateKeyAuthenticationMethod("username",new PrivateKeyFile[]{
new PrivateKeyFile(@"..\openssh.key","passphrase")
}),
}
);
当我运行它时,立即得到一个 DTS 脚本任务:运行时错误“调用的目标已引发异常”。
我已经获取了代码并从中制作了一个独立的控制台应用程序。即使是 4.5,它也运行良好。
整个事情在具有 Sql Server 2008R2 的旧服务器中使用完全相同的代码运行良好
我在新配置中遗漏了一些东西。每当我引用和使用 renci.sshnet 时它都不会运行
我也尝试在写行上设置一个断点,但它没有让我到达那里..在我到达它之前它失败了..
有任何想法吗?我没有选择。
提前致谢。
-肯