WinSCP, Sql Server Integration Services and Visual Basic 200

Advertisement

stebbinsa
Joined:
Posts:
1
Location:
Seattle

WinSCP, Sql Server Integration Services and Visual Basic 200

Is there any way to use the .Net assembly (version 1.0.0.235) for WinSCP 5.0.6.0 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=1.0.0.235, Culture=neutral, PublicKeyToken=xxxxxxx' or one of its dependencies. The system cannot find the file specified.
File name: 'WinSCP, Version=1.0.0.235, Culture=neutral, PublicKeyToken=xxxxxxxxxxx'
at ST_1345935c36bf4112bebcc35508d2419e.vbproj.ScriptMain.Main()

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: WinSCP, Sql Server Integration Services and Visual Basic 200

I do not know SSIS. First hint, this is not related to WinSCP not being able to find winscp.exe as the assembly is not even loaded.
I'll try to find more about SSIS.

Reply with quote

yzorg
Joined:
Posts:
6

try GAC install

stebbinsa,
The WinSCP.dll is strong-signed, and I think it needs to be added to the GAC on your SSIS server for it to be loaded when running in SSIS.

gacutil /i WinSCP.dll

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: try GAC install

yzorg wrote:

stebbinsa,
The WinSCP.dll is strong-signed, and I think it needs to be added to the GAC on your SSIS server for it to be loaded when running in SSIS.

gacutil /i WinSCP.dll
I do not know if that helps. But if you try it, make sure you set Session.ExecutablePath, so that the assembly can find the winscp.exe.

Reply with quote

Advertisement

You can post new topics in this forum