I interpret the C # Windows Phone Application Exclusion Report. The method throws a NullReferenceException . The method goes:
public void OnDelete(object o, EventArgs a) { if (MessageBox.Show(Res.IDS_AREYOUSURE, Res.IDS_APPTITLE, MessageBoxButton.OKCancel) == MessageBoxResult.OK) m_Field.RequestDelete(); }
This is consistent with the fact that m_Field is null - there simply is nothing there that can be null. But here is the mysterious part.
GetILOffset() from the StackFrame from the StackTrace for the exception object returns 0x13. The MSIL for the method, as shown by ILDASM, goes:
IL_0000: call string App.Res::get_IDS_AREYOUSURE() IL_0005: call string App.Res::get_IDS_APPTITLE() IL_000a: ldc.i4.1 IL_000b: call valuetype (...) System.Windows.MessageBox::Show(...) IL_0010: ldc.i4.1 IL_0011: bne.un.s IL_001e IL_0013: ldarg.0 IL_0014: ldfld class App.Class2 App.Class1::m_Field IL_0019: callvirt instance void App.Class2::RequestDelete() IL_001e: ret
That’s what I don’t understand. If the offset is really 0x13, this means that the ldarg line throws an exception. But the command is documented as an exception to any exceptions. This is the callvirt that should quit, right? Or is it an offset relative to something other than the beginning of the method? ldfld can also throw, but only if the this object is null; which is not possible in C # AFAIK.
The docs mention that debugging information may interfere with the offset, but this is a release build.
The DLL that I am viewing with ILDASM is the one that I sent to the Windows Phone Store as part of my XAP.
c # .net-assembly windows-phone cil
Seva Alekseyev
source share