Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Guest

Thanks prikryl. :D
martin

I'm not an expert in SSIS. But in general, references to .NET libraries are not stored with paths in the compiled binary, no matter that you have an explicit path selected in reference in Visual Studio. I assume that when you develop locally, Visual Studio copies the WinSCPnet.dll to the project output directory for you (reference property Copy Local is enabled by default). That's why it's found when testing.

As you have found yourself meanwhile, you need to install the assembly to GAC:
https://winscp.net/eng/docs/library_install#gac

I have now explicitly documented the error you were getting:
https://winscp.net/eng/docs/message_net_system_cannot_find_file_specified
ptreston

Did you manage to resolve this issue ? I am having the same problem. Works fine on my local development environment but when i deploy the SSIS Package to my Production Server, I am receiving the same error.
anub

Hi, I am encountering the same issue, in a similar environment. I followed your suggestion prikryl, but it isn't illuminating for me what is wrong. This is the full exception:

Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'WinSCPnet, Version=1.1.4.3970, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf' or one of its dependencies. The system cannot find the file specified.
File name: 'WinSCPnet, Version=1.1.4.3970, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf'
at ST_c8729c8a88144f1cb830af581ce9e217.csproj.ScriptMain.Main()

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable c:\Program Files (x86)\Microsoft SQL Server\100\DTS\binn\DtsDebugHost.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = anub
LOG: DisplayName = WinSCPnet, Version=1.1.4.3970, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf
(Fully-specified)
LOG: Appbase = file:///c:/Program Files (x86)/Microsoft SQL Server/100/DTS/binn/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\Program Files (x86)\Microsoft SQL Server\100\DTS\binn\DtsDebugHost.exe.Config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: WinSCPnet, Version=1.1.4.3970, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf
LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft SQL Server/100/DTS/binn/WinSCPnet.DLL.
LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft SQL Server/100/DTS/binn/WinSCPnet/WinSCPnet.DLL.
LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft SQL Server/100/DTS/binn/WinSCPnet.EXE.
LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft SQL Server/100/DTS/binn/WinSCPnet/WinSCPnet.EXE.

--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

I get this is an esoteric issue, with SSIS being what it is, but any guidance would be greatly appreciated. I'm stuck. WinSCP is in Microsoft SQL Server/100/DTS/Binn/ and Program Files (x86)/WinSCP/ and my script task is Using WinSCP; and has a reference to the dll contained in Program Files (x86)/WinSCP/.
NickP

SSIS script task using WinSCP error

Hi,

I have developed an SSIS package in BIDS 2008 R2, which works great from the machine I developed it on. However, when I moved the package to the server, I get the following error:
Download Archives,,,6/5/2014 9:15:59 AM,6/5/2014 9:15:59 AM,1,0x,System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'WinSCPnet, Version=1.1.4.3970, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf' or one of its dependencies. The system cannot find the file specified.
File name: 'WinSCPnet, Version=1.1.4.3970, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf'
at ST_ce65898ba1554af38f9ffa906d6d024a.csproj.ScriptMain.Main()

I have added the WinSCPnet.dll to the following folders:
- C:\Program Files\Microsoft SQL Server\100\DTS\Binn
- C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies

I have also registered the assembly, using the following command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCP.dll /codebase /tlb and it created the type library WinSCPnet.tlb in the \\prddsspm001\c$\Program Files\Microsoft SQL Server\100\DTS\Binn folder

I have also added the path to the environment variables!

No luck with any of the above corrections. Any help in this regard would be highly appreciated.

Thanks in advance!
Nick.