上传5mb文件不是问题,但是当我尝试上传14mb时,我的应用程序已关闭。
fileStream = // get some file as stream from isolated storage
uploadClient = new LiveConnectClient(session);
uploadClient.UploadCompleted += new EventHandler<LiveOperationCompletedEventArgs>(uploadClient_UploadCompleted);
uploadClient.UploadAsync("me/skydrive", "filename", fileStream, OverwriteOption.Overwrite, null);
异常(见屏幕截图):
A first chance exception of type 'System.NotSupportedException' occurred in System.Windows.dll
Addtional information: NotSupportedException"
当我使用BackgroundUploadAsync而不是UploadAsync时,文件被传输但是大小为0。
任何人都知道这个问题的解决方案吗?
答案 0 :(得分:0)
我找到了解决方案。
!!!这是重要的 应该仅从主应用程序线程
调用UploadAsync方法