“请求已提交”使用BackgroundUploadAsync时 [英] "The request has already been submitted" when using BackgroundUploadAsync
问题描述
您好,
我正在使用Windows Phone 8应用程序,我将设置文件上传到SkyDrive上的特定文件夹。我面临的问题是,在我的设备上,当我尝试使用BackgroundUploadAsync上传文件时,我收到一条错误消息:"请求
已经提交。"奇怪的是,这在模拟器上工作正常。我已经在下面概述了我的步骤,希望有人可以看到我做错了什么。
I'm working on a Windows Phone 8 app in which I upload a settings file to a particular folder on SkyDrive. The problem that I'm facing is that on my device, when I attempt to upload the file using BackgroundUploadAsync, I get an error saying: "The request has already been submitted." Oddly, this works fine on the emulator. I've outlined my steps below in hopes that somebody can see what I'm doing wrong.
我首先获取文件夹ID(通过获取所有文件夹和文件来完成)根然后解析它以获取我的特定文件夹)
I first get the folder ID (accomplished by getting all of the folders and files at the root then parsing it to get my particular folder)
LiveOperationResult e = await client.GetAsync("me/skydrive/files");
IDictionary<string, object> resultDict = (IDictionary<string, object>)e.Result;
List<object> items = (List<object>)resultDict["data"];
foreach (object o in items)
{
IDictionary<string, object> item = (IDictionary<string, object>)o;
if (item["name"].ToString() == "MyData")
{
folderID = item["id"].ToString();
}
}
这对我来说总是有用。然后我按照请求将文件上传到该特定文件夹:
This always works for me. I then follow with a request to upload the file to that particular folder:
LiveOperationResult fileOpRes = await client.BackgroundUploadAsync(folderID, new Uri(filename, UriKind.Relative), OverwriteOption.Overwrite);
正如我上面所说的,这在模拟器中有效,但我收到"请求已经提交",当我发送错误时部署到我的手机。
As I'd said above, this works in the emulator, but I get the "request has already been submitted" error when I deploy to my phone.
任何帮助?
谢谢!
推荐答案
你能得到小提琴手,看看发生了什么吗?
Can you get fiddler trace and see what happened?
这篇关于“请求已提交”使用BackgroundUploadAsync时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!