Topic "WinSCP, Sql Server Integration Services and Visual Basic 200"

Author Message
stebbinsa
[View user's profile]

Joined: 2012-03-22
Posts: 1
Location: Seattle
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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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.
yzorg
[View user's profile]

Joined: 2012-03-28
Posts: 6
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License