Is there any way to use the .Net assembly (version 220.127.116.11) for WinSCP 18.104.22.168 in a Microsoft SQL Server Integration Services Script Task using Microsoft Visual Basic 2008? I believe SSIS creates the /obj folder on the fly, so it is not possible to copy the WinSCP.exe file to it. When adding a reference WinSCP the script "project", I get the following error message:
Namespace or type specified in the Imports 'WinSCP' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. C:\Documents and Settings\stebbinsa\Local Settings\Temp\SSIS\589f8fb4f4ab4e85a443d26c464d185e\ScriptMain.vb 10 9 st_1345935c36bf4112bebcc35508d2419e
The folder it lists is the temporary folder created whenever the script is opened for editing and the string beginning with st_ is the temporary name of the proejct. If I run the script task anyway, it generates the following error message:
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'WinSCP, Version=22.214.171.124, Culture=neutral, PublicKeyToken=xxxxxxx' or one of its dependencies. The system cannot find the file specified.
File name: 'WinSCP, Version=126.96.36.199, Culture=neutral, PublicKeyToken=xxxxxxxxxxx'
I removed the public key token from the original message above, as I am not clear whether it is sensitive or not, and I don't think it adds any value to understanding the problem. The GUI works fine, but I have not yet been able to get the scripting to work. I have also added the location of WinSCP to my path.