提问人:aufty 提问时间:2/16/2017 最后编辑:aufty 更新时间:2/24/2017 访问量:1854
为什么我的 Xamarin.iOS 应用始终在 Application 类级别引发其 null 异常?
Why does my Xamarin.iOS app always throw its null exceptions at the Application class level?
问:
问题
如果我的代码中的某处存在 null 异常(或各种异常),则 Visual Studio 不会在实际发生 null 引用的地方引发,而是会在此处暂停代码:
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// This is where the application breaks on exception
UIApplication.Main(args, null, "AppDelegate");
}
}
在编写代码时,我可能应该更加小心,但是当应用程序没有破坏空引用实际发生的地方时,调试问题会非常困难。在这里打破什么也没告诉我。是否有可能解决这个问题?
堆栈跟踪示例
Unhandled Exception:
System.NotImplementedException: The method or operation is not implemented.
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/UIKit/UIApplication.cs:63
at AirlineChoice.iOS.Application.Main (System.String[] args) [0x00001] in D:\Development\Airline Choice Suite\Source Code\Development\Airline Choice Mobile\AirlineChoice\AirlineChoice.iOS\Main.cs:12
2017-02-22 16:15:11.780 AirlineChoice.iOS[7647:100649] Unhandled managed exception:
The method or operation is not implemented. (System.NotImplementedException)
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/UIKit/UIApplication.cs:63
at AirlineChoice.iOS.Application.Main (System.String[] args) [0x00001] in D:\Development\Airline Choice Suite\Source Code\Development\Airline Choice Mobile\AirlineChoice\AirlineChoice.iOS\Main.cs:12
答: 暂无答案
评论