使用youtube api时抓住了WebException(https://gdata.youtube.com/feeds/api/users/ {user} / uploads?start-index = 1& max-results = 10& v = 2") 这种情况总是发生,只有设备(Windows Phone-8) 但是,在通过模拟器(WVGA-512)运行时,我找不到任何问题。
目前正在使用System.Net.WebClient的DownloadStringAsync(url);
请在下面找到例外。
System.Net.WebException was caught
_HResult=-2146233079
_message=An exception occurred during a WebClient request.
HResult=-2146233079
IsTransient=false
Message=An exception occurred during a WebClient request.
Source=mscorlib
StackTrace:
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at AppStudio.Data.YouTubeDataProvider.<Load>d__a.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at AppStudio.Data.VideosDataSource.<LoadData>d__0.MoveNext()
InnerException: System.NullReferenceException
_HResult=-2147467261
_message=Object reference not set to an instance of an object.
HResult=-2147467261
IsTransient=false
Message=Object reference not set to an instance of an object.
Source=System.Net
StackTrace:
at System.Net.WebClient.DownloadBitsState.SetResponse(WebResponse response)
at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
InnerException:
也尝试使用HttpClient但没有成功。 如果有人能帮助我,我会很感激。 感谢