XamlParseException: Attribute in custom control missing, but it's defined!

心已入冬 提交于 2019-12-01 14:29:27

I've also came across this issue. I do not have a good explanation for that (seems to be XAML parse bug), but I've fixed it by adding following code to XAML:

<UserControl.Resources>
   <customNamespace:InheritedControl x:Name="dummyInstance"/>
</UserControl.Resources>

I'm no XAML expert but are you missing a namespace on Points (e.g. l:Points)?

caryden

I think that we are seeing the same problem. I just get the invalidcast exception more frequently. When, through blind commenting of stuff, I can suppress the invalidcast, I do sometimes get the attribute missing error for an attribute that is, in fact, there. Have you found a solution?

BTW: the easy way to repro it is to just load the offending app and repeatedly hit F5 to refresh the page. You will get it eventually.

I have also seen an intermittent InvalidOperationException that is through from DependencyObject.get_NativeObject().

see my SO question here: Intermittent InavlidCastException in a UserControl.InitializeComponent()

See my silverlight.net bug report here: http://silverlight.net/forums/t/67732.aspx

I had the same problem. In my case error was on one of members. Exception was thrown on members constructor.
I solved it by putting breakpoint before InitializeComponent() method and on debug mode pressed F11 to Step Into and found error.
Hope this will help.
Thanks.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!