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

dfinch

Re: Debug Log path access issue

Hi Martin, thank you so much, that makes sense now :D
martin

Re: Debug Log path access issue

It's path to a log file, not to log file folder.

So it should be like:
session.DebugLogPath = @"C:\temp\sync\logs\debug\debug.log";
dfinch

Debug Log path access issue

Hi, I am trying to set the debug log file path in C# using:

session.DebugLogLevel = 2;

session.DebugLogPath = @"C:\temp\sync\logs\debug";


However this results in the following error message:


Error: System.UnauthorizedAccess Exception: Access to the path 'C:\temp\sync\logs\debug' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append)
at System.IO.File.CreateText(String path)
at WinSCP.Logger.SetLogPath(String value)
at WinSCP.Session.set_DebugLogPath(String value)
at WinScp2.Program.Main(String[] args) in C:\test\WinScp2\WinScp2\Program.cs:line 36


I am running visual studio as an administrator, and my user has full access to the folder C:\temp\sync\logs\debug. :(

Any help with this would be gratefully received. :)