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

C# 模板Xamarin.Forms Shell应用程序中的InvalidCastException,c#,android,debugging,xamarin,mono,C#,Android,Debugging,Xamarin,Mono,启动模板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

启动模板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, IObjectValueSource source, ObjectPath path, Object obj, 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, 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 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, 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, IObjectValueSource source, ObjectPath path, Object obj, 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, 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 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, 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, IObjectValueSource source, ObjectPath path, Object obj, 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, 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 96
日志的这一段紧跟在与热重新加载相关的几行之前,因此根据提示,我禁用了该功能,并且不会发生异常。所以这肯定是相关的,但这仍然不能告诉我到底发生了什么

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


据我所知,这不会影响应用程序的功能,热重新加载仍然有效。我很好奇到底发生了什么,如果我能做些什么来修复它?

Visual Studio的版本是什么?尝试更新最新版本,创建新的空白xamarin.shell项目,再次构建。我在那里运行的是v16.9.4,我相信这是截至本文的最新版本?可能还需要注意的是,这是在模拟器中运行的,目标是Android SDK 28。尝试将其他设备作为测试目标,模拟器Android 8.1或真实设备。