Debug Log path access issue
Hi, I am trying to set the debug log file path in C# using:
However this results in the following error message:
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. :)
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. :)