Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 应用程序开始崩溃_C#_Ios_Xamarin.ios_Crash - Fatal编程技术网

C# 应用程序开始崩溃

C# 应用程序开始崩溃,c#,ios,xamarin.ios,crash,C#,Ios,Xamarin.ios,Crash,在将我的更新发送到App Store后,当从App Store下载时,应用程序崩溃,但是通过Xamarin Studio进行调试效果很好 但现在,当尝试在我的设备上释放/调试时,它开始崩溃,出现以下错误: 2013-05-21 10:20:30.933 nytLectio[10969:c07] Could not register the assembly 'MBProgressHUD': MonoTouch.MonoTouchException: Cannot register two man

在将我的更新发送到App Store后,当从App Store下载时,应用程序崩溃,但是通过Xamarin Studio进行调试效果很好

但现在,当尝试在我的设备上释放/调试时,它开始崩溃,出现以下错误:

2013-05-21 10:20:30.933 nytLectio[10969:c07] Could not register the assembly 'MBProgressHUD': MonoTouch.MonoTouchException: Cannot register two managed types ('MBProgressHUD.MTMBProgressHUD' and 'AlexTouch.MBProgressHUD.MBProgressHUD') with the same native name ('MBProgressHUD').
  at MonoTouch.Registrar.Registrar.RegisterType (System.Type type, System.Collections.Generic.List`1 exceptions) [0x00000] in <filename unknown>:0 
  at MonoTouch.Registrar.Registrar.RegisterAssembly (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0 
2013-05-21 10:20:30.933 nytLectio[10969:c07]无法注册程序集“MBProgressHUD”:MonoTouch.MonoTouchException:无法使用相同的本机名称(“MBProgressHUD”)注册两个托管类型(“MBProgressHUD.MTMBProgressHUD”和“AlexTouch.MBProgressHUD.MBProgressHUD”)。
位于:0中的MonoTouch.register.register.RegisterType(System.Type类型、System.Collections.Generic.List`1异常)[0x00000]
位于:0中的MonoTouch.register.register.RegisterAssembly(System.Reflection.Assembly Assembly)[0x00000]处

我想这就是导致坠机的原因,但我不知道如何修复它,这让我很困惑,因为它可以在模拟器中进行调试和发布,但不能在我的设备上运行。

您是否尝试过将错误规避到的类AlexTouch.MBProgressHUD.MBProgressHUD的名称更改?

您好,您正在使用两个绑定
MBProgressHUD
的库,
MBProgressHUD.MTMBProgressHUD
AlexTouch.MBProgressHUD.MBProgressHUD
请使用一个,我建议您在这是一个较新版本的
MBProgressHUD
上使用一个,您可以安全地更换当前正在使用的

顺便说一句,我是AlexTouch.MBProgressHUD.MBProgressHUDC#Binding的作者,我可以告诉你它最近没有更新过,所以我鼓励你在网上使用它。他令人赞叹的图书馆

希望这有帮助


Alex

除了@dalexsoto建议(只使用一个版本的库)之外,您需要找出为什么这对您有效

但现在,当尝试在我的设备上释放/调试时,它开始崩溃,出现以下错误:

2013-05-21 10:20:30.933 nytLectio[10969:c07] Could not register the assembly 'MBProgressHUD': MonoTouch.MonoTouchException: Cannot register two managed types ('MBProgressHUD.MTMBProgressHUD' and 'AlexTouch.MBProgressHUD.MBProgressHUD') with the same native name ('MBProgressHUD').
  at MonoTouch.Registrar.Registrar.RegisterType (System.Type type, System.Collections.Generic.List`1 exceptions) [0x00000] in <filename unknown>:0 
  at MonoTouch.Registrar.Registrar.RegisterAssembly (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0 
我的猜测是,您在原始调试/测试和向AppStore提交应用程序之间更新了Xamarin.iOS的版本

这就是为什么您现在在调试/发布设备构建中遇到相同问题的原因。较新版本报告了一个错误情况,其中两个不同的类型使用相同的名称注册(最终行为未定义,因为我们无法预测注册顺序)

如果这仍然适用于本地Mac(在调试/发布版本中),那么我的第二个最佳猜测是调试(和/或发布)的构建选项与AppStore配置的选项不同。这意味着您可能而不是在测试您向客户提供的产品

在这种情况下,您应该检查您的选项、参数(如果需要,还有构建日志),以确保它们仅以正常(预期)方式(例如是否创建调试符号)不同(例如调试构建)。

问题已解决


由于Xamarin的最新版本,我确实更新了beta版,因为我想使用Parse。不过,我会尝试降级到稳定版本,并告诉您它是否更改了最新版本的Xamarin.iOS(包括beta版和下一个尚未发布的稳定版)包括一个更新的注册器,可检测更多问题(包括重复问题)我实际上使用的是Components Store中的版本,因为我现在正在运行测试版,AlexTouch绑定在那个版本上不起作用。谢谢你的C#绑定!:)是的,只是不要同时使用两个库:)