WP7测试手机设备错误,但在模拟器上很好

时间:2012-12-22 02:46:41

标签: wcf windows-phone-7 odata

我在手机设备上调试时出错,但在模拟器上没有。每次从服务器请求数据时都会出错(使用IIS Express使用WCF / Odata托管)。相关代码如下(请注意,所有数据访问都会出现问题):

public void LoadData()
    {
        IsDataLoaded = false;

        string queryUri = string.Format("Jobs?$filter=ApplicantID eq {0}", 1);
        jobData.LoadAsync(new Uri(queryUri, UriKind.Relative));
        jobData.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(jobData_LoadCompleted);
    }

    void jobData_LoadCompleted(object sender, LoadCompletedEventArgs e)
    {
        if (e.Error != null)
        {
            MessageBox.Show(e.Error.Message);
        }
        else
        {
            if (jobData.Continuation != null)
            {
                jobData.LoadNextPartialSetAsync();
            }
        }

        IsDataLoaded = true;
    }

当我使用模拟器时,一切正常,但是当我使用WP7设备时,我收到一个很大的错误:处理此请求时出错

更好的是,内部异常只是说NotFound。

即使是堆栈跟踪也没那么有用:

 at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult)
 at System.Data.Services.Client.QueryResult.EndExecute[TElement](Object source, IAsyncResult asyncResult)
 at System.Data.Services.Client.DataServiceRequest.EndExecute[TElement](Object source, DataServiceContext context, IAsyncResult asyncResult)
 at System.Data.Services.Client.DataServiceContext.EndExecute[TElement](IAsyncResult asyncResult)
 at System.Data.Services.Client.DataServiceCollection`1.<>c__DisplayClass6.<LoadAsync>b__5(IAsyncResult asyncResult)
 at System.Data.Services.Client.DataServiceCollection`1.<>c__DisplayClass11.<>c__DisplayClass13.<BeginLoadAsyncOperation>b__f()
 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)

有没有人有此并先前解决过它?

0 个答案:

没有答案