微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

模板 Xamarin.Forms Shell 应用程序中的 InvalidCastException

如何解决模板 Xamarin.Forms Shell 应用程序中的 InvalidCastException

启动模板 Xamarin.Forms Shell 应用程序时,在应用程序启动时出现以下异常:

system.invalidCastException: Unable to cast object of type 'Mono.Debugger.soft.PointerValue' to type 'Mono.Debugger.soft.PrimitiveValue'.
   at Mono.Debugging.soft.softDebuggerAdaptor.TargetobjectToObject(EvaluationContext ctx,Object obj) in C:\A\1\216\s\external\debugger-libs\Mono.Debugging.soft\SoftDebuggerAdaptor.cs:line 2673
   at Mono.Debugging.Evaluation.ExpressionEvaluator.TargetobjectToExpression(EvaluationContext ctx,Object obj) in C:\A\1\216\s\external\debugger-libs\Mono.Debugging\Mono.Debugging.Evaluation\ExpressionEvaluator.cs:line 87
   at Mono.Debugging.Evaluation.ObjectValueAdaptor.CreateObjectValueImpl(EvaluationContext ctx,IObjectValueSource source,ObjectPath path,Object obj,ObjectValueFlags flags) in C:\A\1\216\s\external\debugger-libs\Mono.Debugging\Mono.Debugging.Evaluation\ObjectValueAdaptor.cs:line 474
   at Mono.Debugging.soft.softDebuggerAdaptor.CreateObjectValueImpl(EvaluationContext ctx,ObjectValueFlags flags) in C:\A\1\216\s\external\debugger-libs\Mono.Debugging.soft\SoftDebuggerAdaptor.cs:line 1545
   at Mono.Debugging.Evaluation.ObjectValueAdaptor.CreateObjectValue(EvaluationContext ctx,ObjectValueFlags flags) in C:\A\1\216\s\external\debugger-libs\Mono.Debugging\Mono.Debugging.Evaluation\ObjectValueAdaptor.cs:line 96
system.invalidCastException: Unable to cast object of type 'Mono.Debugger.soft.PointerValue' to type 'Mono.Debugger.soft.PrimitiveValue'.
   at Mono.Debugging.soft.softDebuggerAdaptor.TargetobjectToObject(EvaluationContext ctx,ObjectValueFlags flags) in C:\A\1\216\s\external\debugger-libs\Mono.Debugging\Mono.Debugging.Evaluation\ObjectValueAdaptor.cs:line 96

日志的这一部分紧跟在与热重载相关的几行之前,因此根据提示我禁用了该功能并且不会发生异常。所以它肯定是相关的,但这仍然不能告诉我实际发生了什么。

我正在运行 Xamarin.Forms 5.0.0.2012 和 Xamarin.Essentials 1.6.1。这发生在选项卡式和弹出式模板中。

据我所知,这不会影响应用功能,并且热重载仍然有效。我主要只是想知道发生了什么,如果我能做些什么来解决它?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。