Xamarin IOS调试,应用程序崩溃,没有错误



当我在IOS Emulator中从Visual Studio调试运行应用程序时,应用程序会启动,显示启动屏幕,然后崩溃。Visual Studio继续显示正常的行为,就像它仍然附加到调试过程中一样,一切都按计划进行。

当我在模拟器上手动启动相同的应用程序时,它运行得很好。

调试日志总是这样:

加载的程序集:/Users/admin/Library/Developer/CoreSimulator/Devices/40C63365-3924-44EA-9145-AAF5F59D170F/data/Channels/Bundle/Application/FED2C1CB-FD8E-441A-856C-66981DB384B5/WebtutorMobileX.iOS.app/Xamarin.iOS.dll[外部]加载的程序集:/用户/admin/Library/Developer/CoreSimulator/Devices/40C63365-3924-44EA-9145-AAF5F59D170F/data/Channels/Bundle/Application/FED2C1CB-FD8E-441A-856C-66981DB384B5/WebtutorMobileX.iOS.app/System.dll[外部]加载的程序集:/Users/admin/Library/Developer/CoreSimulator/Devices/40C63365-3924-44EA-9145-AAF5F59D170F/data/Channels/Bundle/Application/FED2C1CB-FD8E-441A-856C-66981DB384B5/WebtutorMobileX.iOS.app/Mono.Security.dll[External]

在该应用程序崩溃后,什么也没发生。Visual Studio一直处于无知之中。

没有任何错误。

这是在我升级到4.7.0.1179和XCode 11.6之后开始的。Visual Studio 2019 16.6.5。

将iOS链接器设置更改为"仅链接框架SDK";已为我修复(如果2022年仍有人存在此问题(。

适用于Mac的VS 17.3.8-XCode 14-XF 5.0.0.2515

在xamarin.ios项目的Main.cs文件中放置一个try/catch块,并在catch块中放置断点,它通常会"告诉"您在这种崩溃中出了什么问题。

public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
try
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, "AppDelegate");
}
catch (Exception ex)
{
//Breakpoint here
}

}
}

Visual Studio版本16.7.4+Xamarin IOS 14.0,重新调试工作。

相关内容

最新更新