c# - Xamarin App 仅在 Debug模式下崩溃

标签 c# ios xamarin

我有一个非常基本的应用程序,用于测试第 3 方库绑定(bind)。我通过界面生成器创建了一个 IBAction。当我单击连接到 IBAction 的按钮时,我的应用程序崩溃了。这只发生在 Debug模式下。该应用程序在 Release模式下或在我的设备上运行时不会崩溃。崩溃甚至发生在任何 IBAction 方法被调用之前。

这是在控制台上记录的错误:

2014-09-12 08:38:45.293 VinScanSandBox[33818:70b] instance: <CSSNMobileSDKController: 0x7a6a8a30>
mono-rt: Stacktrace:


mono-rt:   at <unknown> <0xffffffff>

mono-rt:   at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x000a6, 0xffffffff>

mono-rt:   at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:39

mono-rt:   at VinScanSandBox.Application.Main (string[]) [0x00008] in /Users/scordova/Projects/VinScanSandBox/VinScanSandBox/Main.cs:17

mono-rt:   at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>

mono-rt: 
Native stacktrace:


mono-rt: 
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

更新:取消选中“启用调试”修复了崩溃,但没有向我解释为什么它首先发生。仍在寻找完整的解决方案。

最佳答案

如果您在您的应用中使用 ListView ,请尝试添加 ListView 的以下属性 ListView 缓存策略="回收元素

在所有 ListView 的 .xaml 文件中

关于c# - Xamarin App 仅在 Debug模式下崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25809724/

相关文章:

c# - 当应用程序退出时终止进程外 dll ('dllhost.exe' 'COM Surrogate' 的最佳方法?

c# - C# 中有长版本的 IntPtr 吗?

c# - MySQL(和c#?)转换字符格式

ios - 设置属性导致 EXC_BAD_ACCESS 崩溃(CLLocationManager Singleton)

iphone - 观看 WWDC 2010 视频的建议顺序

c# - 如何删除 CollectionView IOS 中行之间的额外行间距?

xamarin - 如何更改 Xamarin Forms 中的 TabBar 和 NavigationBar 颜色?

c# - 如何设置 ClientCredentials?

android - 是否可以将 Xamarin 项目编译为适用于 iOS 和 Android 的库?

sqlite - 如何使用Azure移动服务正确同步Xamarin iOS Sqlite