简体   繁体   中英

NullReferenceException where Source and StrackTrace is null in wp8

In my Windows Phone 8 solution I sometimes get what seems to be random null reference exceptions when returning to the main panorama view.

However, despite having Debug compilation, I don't get any hint at all on what went wrong. How come Source and StackTrace is null? Is there any way I can find out what threw it?

在此处输入图片说明

EDIT: Exceptions is set to break when a System.NullReferenceException is thrown. It doesn't break into the debugger for this Exception. It does work fine for other exceptions.

EDIT2: With just my code disabled I get two stack frames in the call stack window:

MyApp.DLL!MyApp.Application_UnhandledException(object sender, System.Windows.ApplicationUnhandledExceptionEventArgs e) Line 179 C#
System.Windows.ni.dll!MS.Internal.Error.CallApplicationUEHandler(System.Exception e)    Unknown
System.Windows.ni.dll!MS.Internal.Error.CallAUEHandler(uint hr, out uint bIsHandled)    Unknown

The exception object gets a bunch more fields and properties visible, but everything is null except for what's shown in the screenshot above.

EDIT3: Intellitrace and backtracing is not an option since it doens't work with silverlight and windows phone.

I've added tracing to all of the code using postsharp, and it's not stemming from within any of my code unfortunately. The last thing happening is that I successfully exit LongListSelector_ItemRealized.

I'm not sure why the stacktrace is empty. Though, to debug your issue, you can gather more information by enabling Visual Studio to break on any first-chance exception (Control + Alt + e, and check the box in front of "Common Language Runtime Exceptions). Then when the exception occurs, look in the "call stack" window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM