Windows phone 7 HttpWebRequest在设备上不工作

Windows phone 7 HttpWebRequest在设备上不工作,windows-phone-7,httpwebrequest,Windows Phone 7,Httpwebrequest,我读过一些包含这个问题的主题,但没有一个答案是有用的,或者主题最后没有解决 所以,我的应用程序在emulator上运行良好,但在设备上不起作用(HTC Trophy it,这有什么关系?)。我捕捉到这样的异常: System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: No

我读过一些包含这个问题的主题,但没有一个答案是有用的,或者主题最后没有解决

所以,我的应用程序在emulator上运行良好,但在设备上不起作用(HTC Trophy it,这有什么关系?)。我捕捉到这样的异常:

System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
   at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
   at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClass2.<EndGetResponse>b__1(Object sendState)
   at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__0(Object sendState)
   at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
   at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at System.Delegate.DynamicInvokeOne(Object[] args)
   at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.Windows.Threading.Dispatcher.<>c__DisplayClass4.<FastInvoke>b__3()
   at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
   at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at System.Delegate.DynamicInvokeOne(Object[] args)
   at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)
   at System.Windows.Threading.Dispatcher.OnInvoke(Object context)
   at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args)
   at System.Windows.Hosting.DelegateWrapper.InternalInvoke(Object[] args)
   at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)

   at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
   at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at Birdaholic1.AddSighting.GetResponseCallback(IAsyncResult asynchronousResult)
   at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClassa.<InvokeGetResponseCallback>b__8(Object state2)
   at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadPool.WorkItem.doWork(Object o)
   at System.Threading.Timer.ring()
System.Net.WebException:远程服务器返回错误:NotFound。-->System.Net.WebException:远程服务器返回错误:NotFound。
位于System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
在System.Net.Browser.ClientHttpWebRequest.c__DisplayClass2.b__1(对象发送状态)中
在System.Net.Browser.AsyncHelper.c__DisplayClass4.b__0(对象发送状态)中
在System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi、对象obj、BindingFlags invokeAttr、绑定器绑定器、对象参数、CultureInfo区域性、布尔值isBinderDefault、程序集调用者、布尔值验证访问、堆栈爬网标记和堆栈标记)
位于System.Reflection.RuntimeMethodInfo.InternalInvoke(对象obj、BindingFlags invokeAttr、绑定绑定器、对象[]参数、CultureInfo区域性、StackScrawMark和stackMark)
在System.Reflection.MethodBase.Invoke(对象obj,对象[]参数)处
位于System.Delegate.DynamicInvokeOne(对象[]args)
位于System.MulticastDelegate.DynamicInvokeImpl(对象[]args)
位于System.Delegate.DynamicInvoke(对象[]args)
在System.Windows.Threading.Dispatcher.c__DisplayClass4.b__3()中
在System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi、对象obj、BindingFlags invokeAttr、绑定器绑定器、对象参数、CultureInfo区域性、布尔值isBinderDefault、程序集调用者、布尔值验证访问、堆栈爬网标记和堆栈标记)
位于System.Reflection.RuntimeMethodInfo.InternalInvoke(对象obj、BindingFlags invokeAttr、绑定绑定器、对象[]参数、CultureInfo区域性、StackScrawMark和stackMark)
在System.Reflection.MethodBase.Invoke(对象obj,对象[]参数)处
位于System.Delegate.DynamicInvokeOne(对象[]args)
位于System.MulticastDelegate.DynamicInvokeImpl(对象[]args)
位于System.Delegate.DynamicInvoke(对象[]args)
在System.Windows.Threading.DispatcherOperation.Invoke()中
在System.Windows.Threading.Dispatcher.Dispatch中(DispatcherPriority优先级)
位于System.Windows.Threading.Dispatcher.OnInvoke(对象上下文)
位于System.Windows.Hosting.CallbackCookie.Invoke(对象[]args)
位于System.Windows.Hosting.DelegateWrapper.InternalInvoke(对象[]args)
位于System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle、Int32 nParamCount、ScriptParam[]pParams、ScriptParam&pResult)
位于System.Net.Browser.AsyncHelper.BeginNoui(SendOrPostCallback beginMethod,对象状态)
位于System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
在Birdaholic1.AddSighting.GetResponseCallback(IAsyncResult asynchronousResult)
在System.Net.Browser.ClientHttpWebRequest.c__中显示ClassA.b__8(对象状态2)
位于System.Threading.ThreadPool.WorkItem.WaitCallback\u上下文(对象状态)
在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态)
在System.Threading.ThreadPool.WorkItem.doWork(对象o)处
在System.Threading.Timer.ring()中

我该怎么办?我应该从哪里开始修复它?

检查清单:

  • URI
    -对象是否设置了
    UriKind.Absolute
    属性
  • 我的手机是否有数据连接(如Facebook、internet explorer等其他应用是否可用)
  • 如果是这样,我可以在web浏览器中打开URL(假设它是
    GET
    -请求)并找到它吗
如果所有这些问题的答案都是肯定的,请尽可能使用第二台设备,并尝试重新创建问题。如果它仍然存在,看看服务器端的事情,也许缓存因为某种原因把你搞砸了


猎虫快乐

非常常见的错误(未找到)。您的设备是否已连接到网络?是。当连接到PC时,通过WIFI和电缆均不工作1。它不是乌里金的。绝对的,但换了以后还是不起作用。2.其他一切都在起作用。3.这是OAuth的POST请求,这里很奇怪,因为其他POST方法显示我没有经过身份验证,这一次除了没有经过身份验证的信息之外,没有显示任何东西。。。似乎问题出在服务器端(但我还是会试试其他手机)