I have the same problem. Your FromAsync answer is correct. The same problem occurs when calling BeginPutObject / EndPutObject directly without the FromAsync shell.
The synchronous method AmazonS3Client.PutObject () has this body:
IAsyncResult asyncResult; asyncResult = invokePutObject(request, null, null, true); return EndPutObject(asyncResult);
While AmazonS3Client.BeginPutObject says:
return invokePutObject(request, callback, state, false);
Pay attention to the last boolean parameter invokePutObject. This argument is called "synchronized." If you call it with synchronized = true, it works (by performing the operation synchronously). If you call it with synchronized = false, during parallel loading you will get the exception that you sent.
This is clearly a bug in the AWS SDK, which needs further investigation. This post on AWS forums looks similar, but it may not be the same problem; I am not satisfied with the response to the upstream there, since simultaneous synchronous downloads work.
ETA . The new AWS SDK version 2.0 (in beta at the time of writing), which requires .Net 4.5, has its own FooAsync methods (insted of Begin / EndFoo). It is based on the new System.Net.HttpClient library instead of the old HttpWebRequest. It almost certainly does not have this error, but I have not tested it myself yet.
source share