Windows Phone 7.1中的OutOfMemoryException

时间:2012-12-11 16:00:43

标签: windows windows-phone-7 windows-phone-7.1 windows-phone-8

我在WP7.1应用中获得OutOfMemoryException。这是堆栈跟踪:

  

at System.String.ReplaceOrdinal(String oldValue,String newValue)   在System.String.Replace(String oldValue,String newValue)at   A_Contacts.ContactSync.ProcessDataFirstTime(APhone p)at   A_Contacts.ContactSync.ContactsOnSearchCompletedFirstTime(IEnumerable`1 t)at A_Contacts.ContactSync.Contacts_SearchCompleted2(Object sender,   ContactsSearchEventArgs e)at   Microsoft.Phone.UserData.Contacts.OnSearchCompleted(Object e)at   System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo   rtmi,Object obj,BindingFlags invokeAttr,Binder binder,Object   参数,CultureInfo文化,布尔isBinderDefault,汇编   调用者,布尔验证访问,StackCrawlMark& stackMark)at   System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,   BindingFlags invokeAttr,Binder binder,Object []参数,   CultureInfo culture,StackCrawlMark& stackMark)at   System.Reflection.MethodBase.Invoke(Object obj,Object []参数)   在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   System.Windows.Threading.Dispatcher.OnInvoke(Object。的优先级)   System.Windows.Hosting.CallbackCookie.Invoke(Object []上下文)   args)at   System.Windows.Hosting.DelegateWrapper.InternalInvoke(Object [] args)   在System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr   pHandle,Int32 nParamCount,ScriptParam [] pParams,ScriptParam&   pResult)

1 个答案:

答案 0 :(得分:0)

感谢Brian,我做了同样的事情,经过大量的研究,我发现Code First Database表没有正确形成;因为在提到的属性上允许NULL但是属性不是NULLable。