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

martin

Re: SSIS and WinSCP

Can you answer my question please: What specific exception that has an inner exception are you referring to?
Guest

Re: SSIS and WinSCP

martin wrote:

Thanks for your report.
What specific "inner exception" do you refer to? Recent versions of WinSCP .NET assembly do not throw exceptions with an inner exception anymore.


Martin,

see csharp demo code on page
https://winscp.net/eng/docs/library_ssis#example

you should whiteout 'e.InnerException' instead of just 'e'...
martin

Re: SSIS and WinSCP

Thanks for your report.
What specific "inner exception" do you refer to? Recent versions of WinSCP .NET assembly do not throw exceptions with an inner exception anymore.
kwenix

SSIS and WinSCP

Hi Martin,

2 things when working with SSIS:

1. the source code provided in csharp for integrating winscp in SSIS package uses a try/except construct. In the exception part, the demo code simply 'spits' out the exception object, but I learned the hard way (see point 2) that the 'real' error message is in the 'innerexception' property of the exception object. I would propose to adapt the demo code to 'spit' out the e.InnerException by default.

2. I created a SSIS package with parameters, so that during development the package would connect to a test server. Once deployed on a SQL server, I scheduled a package in which I adapted (override) the default parameters, in order to have winscp upload files to production server. As a result, the server fingerprint also changes, which is why I provided this value as a parameter. When entering the server fingerprint as a parameter in the scheduled package, I copy/pasted the value as I got it from WinSCP and got something like 'rsa 2048 xxxxxx'. The package would systematically fail upon scheduled execution and it took me some time to find root cause (see point 1). As it turns out, the SSIS package got a parameter value from the scheduled job in this format 'rsa "2048" xxxxx' (note the quotes surrounding the fingerprint key length), which WinSCP refused as it did not match the expected fingerprint format (regex expression). So while this is _NOT_ a WinSCP problem, I wanted to signal this and make my point for the change documented in point 1. If the demo code had given me the InnerException value, I would have found the root cause quicker.

For your info, all is working now as I 'danced around' this parameter issue.

thanks for considering this and if you need more info or a demo, don't hesitate