模板 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 (将#修改为@)