This error is raised when you are trying to execute two methods simultaneously on the Ftp object. Because the code you provided is logically correct, I suppose that the cause of the problem is somewhere else.
Please note, that you cannot use Ftp object until the specified code is completed. This leads to design like this:
var ftp = new Ftp();
ftp.Connect(...);
ftp.Login(...);
var task = ftp.ChangeDirectoryAsync("/");
task = task.ContinueWith(task1 =>
{
// simply call synchronous methods,
// because continuation task is run asynchronously
var list = ftp.GetList();
foreach (var listItem in list)
{
LoggerRepository.AddMessage(listItem.Name);
}
});
task.Wait();
// now you can use Ftp object again
// ...
ftp.ChangeDirectoryAsync("/home");
...