Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.7k views
in .NET FTP by (120 points)
Hi,

I'm trying to connect to a server using FTPExplicit. But when I try to connect to the server, I get this error : Couldn't acquire crypto service provider context (-2146893809). Can you please let me know what is wrong. The same code was working earlier.

' Instantiate SecureFTPConnection
Dim ftpConnection As New EnterpriseDT.Net.Ftp.SecureFTPConnection

' setting server address and credentials
ftpConnection.ServerAddress = "XXXXXX"
ftpConnection.UserName = "XXXXX"
ftpConnection.Password = "XXXXX"


' select FTPSExplicit
ftpConnection.Protocol = EnterpriseDT.Net.Ftp.FileTransferProtocol.FTPSExplicit
ftpConnection.ServerValidation = EnterpriseDT.Net.Ftp.SecureFTPServerValidationType.None

' connect to server
ftpConnection.Connect()

Please note I used XXXXX in the place of serveraddress, username and password. Please email me and I can give you the actual server details.
Please respond at the earliest.

Thanks,
Elizabeth

1 Answer

0 votes
by (162k points)
The most likely cause of this problem is that the user that you are running with does not have permissions to access the key store.

It can usually be resolved by deleting the key stores for the user. You need to remove the directories below this directory for the user running the application:

C:\Users\username\AppData\Roaming\Microsoft\Crypto\RSA

I would simply rename the directories as xxx.old rather than deleting them - then it is easy to go back.

You may also need to do the same to the All Users RSA directory.

Categories

...