Attempted to read or write protected memory. - WeOnlyDo Discussion board

Attempted to read or write protected memory. (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Archit.Aggarwal@in.ey.com, Wednesday, March 17, 2010, 11:44 (5366 days ago)

Hi,

I am haivng a windows service is which is making two asynchronous calls to the following function code if the two calls are made at exactly the same time it results into “Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” Error. The error occurs at the lines in which I am using “WeOnlyDo.Security.Cryptography” assembly.

Can you help me out with this issue.

I am using
1. WeOnlyDo.Client.SFTP.dll - 3.2.5.64

Public Sub SftpConnect()
Sftp = New SFTP()
Sftp.Hostname = “HostName”
Sftp.Login = “UserName”
Sftp.Timeout = 0
Sftp.LicenseKey = “LicenseKey”
Dim km As New WeOnlyDo.Security.Cryptography.KeyManager()
Dim type As New WeOnlyDo.Security.Cryptography.SSHKeyTypes()
type = km.Load(Decrypt(KeyPath))
Sftp.PrivateKey = km.PrivateKey(type)
Sftp.Authentication = WeOnlyDo.Client.SFTP.Authentications.PublicKey
Sftp.Blocking = True
Sftp.Connect()
End Sub


Complete thread: