Post a reply

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: Unable to create log file error

Wouldn't it be better to fix your local account set up? You must have other problems, if its TEMP point to a folder that does not exist.
Anyway, there's an undocumented Session.XmlLogPath property.
Lee M

Unable to create log file error

Using WinSCP .NET assembly, I'm getting this error:
2021-05-04 15:24:39,529 [1] ERROR Helpers.SftpProcessor - WinSCP.SessionLocalException: WinSCP process terminated with exit code 1. Error output was "Can't open log file 'C:\Users\Lee M\AppData\Local\Temp\2\wscp2FB8.0259F9D2.tmp'.
System Error. Code: 2.
The system cannot find the file specified
Error occurred during logging. Cannot continue.". Response log file C:\Users\Lee M\AppData\Local\Temp\2\wscp2FB8.0259F9D2.tmp was not created. This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
at WinSCP.Session.Open(SessionOptions sessionOptions)
at Helpers.SftpProcessor.SetUpRemoteFolderStructure() in C:\Repos\SftpProcessor\Main\SftpProcessor\Helpers\SftpProcessor.cs:line 291

It works if I run the command prompt as administrator. Is there a way to change the location WinSCP uses to log?
Thanks,
Lee