Re: WinSCP.exe in .NET Core Lambda function
Your duplicate (and answered) question on Stack Overflow:
WinSCP.exe missing in .NET Core AWS Lambda Function
WinSCP.exe missing in .NET Core AWS Lambda Function
Session.Open()
:
WinSCP.SessionLocalException: The winscp.exe executable was not found at location of the assembly WinSCPnet (/var/task), nor the entry assembly Amazon.Lambda.RuntimeSupport (/var/runtime), nor in an installation path. You may use Session.ExecutablePath property to explicitly set path to winscp.exe.
ExecutablePath
like this, and it works:
[FunctionName(FunctionName)]
public static void Run([TimerTrigger("%XXXSendSchedule%")] TimerInfo myTimer, ILogger log, ExecutionContext executionContext)
. . .
using (Session winscpSession = new Session())
{
// See https://winscp.net/eng/docs/guide_microsoft_azure_function_sftp
winscpSession.ExecutablePath = Path.Combine(executionContext.FunctionAppDirectory, "winscp.exe");
ILambdaContext
does not seem to have anything like Azure's FunctionAppDirectory
:
public void MyFunctionHandler(ILambdaContext context)