我正在开发一个xamarin.forms应用程序,但我无法调试我的任何应用程序,因为每次运行调试器时,运行都是成功的,但以下消息显示:

它来自InitializeComponents(),如果我从我的xaml页面中删除所有的childs,我可以再次运行这个应用程序,但是在下一个打开的页面中我会得到相同的错误。
这是XAML:(太简单了,我找不出错误.)
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="myproject.SplashScreen">
<ActivityIndicator IsRunning="True" VerticalOptions="Center" HorizontalOptions="Center"/>
</ContentPage>对这个问题有什么想法吗?谢谢
编辑:
这是应用程序的输出:
04-20 11:35:58.233 E/mono ( 4971):
04-20 11:35:58.233 E/mono ( 4971): Unhandled Exception:
04-20 11:35:58.233 E/mono ( 4971): System.MissingMethodException: Method 'LayoutOptionsConverter.ConvertFromInvariantString' not found.
04-20 11:35:58.233 E/mono ( 4971): at (wrapper dynamic-method) System.Object:78a6d746-06e3-4db1-9bc3-6adf844731f4 (intptr,intptr,intptr)
04-20 11:35:58.233 E/mono ( 4971): at (wrapper native-to-managed) System.Object:78a6d746-06e3-4db1-9bc3-6adf844731f4 (intptr,intptr,intptr)
04-20 11:35:58.233 E/mono-rt ( 4971): [ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method 'LayoutOptionsConverter.ConvertFromInvariantString' not found.
04-20 11:35:58.233 E/mono-rt ( 4971): at (wrapper dynamic-method) System.Object:78a6d746-06e3-4db1-9bc3-6adf844731f4 (intptr,intptr,intptr)
04-20 11:35:58.233 E/mono-rt ( 4971): at (wrapper native-to-managed) System.Object:78a6d746-06e3-4db1-9bc3-6adf844731f4 (intptr,intptr,intptr)发布于 2016-04-21 10:35:02
我通过创建一个新项目来解决这个问题,所有的页面和类都和以前一样。我不知道为什么,但现在这个新项目进展顺利。这不是bug的解决方案,但仍然是使代码再次工作的一种方法。
谢谢大家的帮助
发布于 2016-09-05 18:09:51
以防万一,这对任何人都有帮助:我在Xamarin窗体(同样的结果是调试Android和Local )中遇到了这个错误。我通过在Windows中调试并检查异常的“细节”来解决我的问题。它实际上是两个不同的东西,第一个是我通过没有默认构造函数的XAML绑定一个类(只需要为序列化做一个空的构造函数),第二个是在我正在使用的MasterDetailPage的内容页面中没有"Title“属性;对于Xamarin来说,这显然是致命的罪过(因为跨平台代码生成).
发布于 2016-04-20 16:51:22
试试这个:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="myproject.SplashScreen">
<StackLayout>
<ActivityIndicator IsRunning="True" VerticalOptions="Center" HorizontalOptions="Center"/>
</StackLayout>
</ContentPage>https://stackoverflow.com/questions/36748218
复制相似问题