System.Exception when running SearchAsync of Contacts in application_launching event handler 未处理Exception
2012-06-06 22:14
555 查看
Why do i get this exception:
System.Exception was unhandled
Message=Exception
StackTrace:
at
Microsoft.Phone.UserData.QueryDataEnumerable`1.EnsureInteropInit()
at
Microsoft.Phone.UserData.QueryDataEnumerable`1.GetNextBatch(Int32
nextIndex)
at
Microsoft.Phone.UserData.QueryDataEnumerator`1.MoveNext()
at
Microsoft.Phone.UserData.Contacts.GetContacts(Object state)
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()
when i run these lines of code in the
"application_launching" event handler on App.xaml.cs
Contacts cons = new Contacts();
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(CompletedSearch);
cons.SearchAsync(null, FilterKind.PhoneNumber, null);
Note: if i comment out
the line
cons.SearchAsync(null, FilterKind.PhoneNumber, null);
I dont get an exception
anymore. But I need that to run in order for my app to
work!!
Thanks,
David
System.Exception was unhandled
Message=Exception
StackTrace:
at
Microsoft.Phone.UserData.QueryDataEnumerable`1.EnsureInteropInit()
at
Microsoft.Phone.UserData.QueryDataEnumerable`1.GetNextBatch(Int32
nextIndex)
at
Microsoft.Phone.UserData.QueryDataEnumerator`1.MoveNext()
at
Microsoft.Phone.UserData.Contacts.GetContacts(Object state)
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()
when i run these lines of code in the
"application_launching" event handler on App.xaml.cs
Contacts cons = new Contacts();
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(CompletedSearch);
cons.SearchAsync(null, FilterKind.PhoneNumber, null);
Note: if i comment out
the line
cons.SearchAsync(null, FilterKind.PhoneNumber, null);
I dont get an exception
anymore. But I need that to run in order for my app to
work!!
Thanks,
David
Re: System.ExceptionReply Quote | |
|
相关文章推荐
- Getting System.OutOfMemoryException when using ReportViewer contol in Local mode
- Error: Exception was raised when calling event-notify Vuser function in extension parameng.dll: System Exceptions: EXCEPTION_ACCESS_VIOLATION
- System.OutOfMemoryException error thrown when running ReportViewer
- The problem of waiting time when launching a unix shell command from an application engine
- “System.OutOfMemoryException”类型的异常在 mscorlib.dll 中发生,但未在用户代码中进行处理
- java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread 报错解决
- Net 内存溢出(System.OutOfMemoryException)的常见情况和处理方式总结
- Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
- “System.OutOfMemoryException”类型的未经处理的异常在 mscorlib.dll 中发生
- Problems with System.OutOfMemoryException At System.String.GetStringForStringBuilder in 32-Bit Managed Solutions
- An error message detailing the cause of this specific request failure can be found in the application event log of the
- n unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module.Additional information: 未能加载文件或程序集“..
- Using the Web Services and COM+ Event System in the .Net Application.
- .Net 内存溢出(System.OutOfMemoryException)的常见情况和处理方式总结
- c# 处理大批量数据 时遇到 类型为“System.OutOfMemoryException”的异常
- [ZT]处理Exception of type System.OutOfMemoryException was thrown [转]
- 生产环境elasticsearch5.0报错IllegalArgumentException: number of documents in the index cannot exceed 2147483519的处理
- PRB: "Requested Registry Access Is Not Allowed" Error Message When ASP.NET Application Tries to Write New EventSource in the Eve
- BadImageFormatException: 无法加载引用程序集来执行,无法加载System.ComponentModel.EventBasedAsync
- “System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 错误