Cannot access the file '...wscp9D6C.00283D6C.tmp' because it is being used by another process
Using session As New Session session.Open(sessionOptions) Dim transferOptions As New TransferOptions transferOptions.TransferMode = TransferMode.Binary Parallel.ForEach(imageList, Sub(imagePath) ProcessWinScp(imagePath, session, transferOptions) End Sub) End Using
Here is where I initialize session options
Dim sessionOptions As New SessionOptions With sessionOptions .Protocol = Protocol.Ftp .HostName = xx .UserName = xx .Password = xx End With
mscorlib.dll!System.IO.__Error.WinIOError(int errorCode, string maybeFullPath) Unknown
mscorlib.dll!System.IO.FileStream.Init(string path, System.IO.FileMode mode, System.IO.FileAccess access, int rights, bool useRights, System.IO.FileShare share, int bufferSize, System.IO.FileOptions options, Microsoft.Win32.Win32Native.SECURITY_ATTRIBUTES secAttrs, string msgPath, bool bFromProxy, bool useLongPath, bool checkHost) Unknown
mscorlib.dll!System.IO.FileStream.FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) Unknown
mscorlib.dll!System.IO.File.Open(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) Unknown
WinSCPnet.dll!WinSCP.SessionLogReader.OpenLog() Unknown
WinSCPnet.dll!WinSCP.SessionLogReader.DoRead() Unknown
WinSCPnet.dll!WinSCP.SessionLogReader.Read(WinSCP.LogReadFlags flags) Unknown
WinSCPnet.dll!WinSCP.CustomLogReader.TryWaitForNonEmptyElement(string localName, WinSCP.LogReadFlags flags) Unknown
WinSCPnet.dll!WinSCP.CustomLogReader.WaitForNonEmptyElement(string localName, WinSCP.LogReadFlags flags) Unknown
WinSCPnet.dll!WinSCP.Session.Open(WinSCP.SessionOptions sessionOptions) Unknown