如何调试 XamlParseException? [英] How do you debug a XamlParseException?

查看:25
本文介绍了如何调试 XamlParseException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的 Silverlight 应用程序中使用第 3 方组件,当我尝试创建控件的实例时,我收到 XamlParseException:

I'm trying to use a 3rd party component in my Silverlight application and when I try to create an instance of the control, I get a XamlParseException:

{System.Windows.Markup.XamlParseException: **Set property 'System.Windows.FrameworkElement.Style' threw an exception.** [Line: 0 Position: 0] 
---> System.Windows.Markup.XamlParseException: **Elements in the same ResourceDictionary cannot have the same x:Key** [Line: 1739 Position: 47]    
at MS.Internal.XcpImports.CreateFromXaml(UnmanagedMemoryStream stream, String sourceAssemblyName, boolean createNamescope, Boolean requireDefaultNamespace, Boolean allowEventHandlers)    
at System.Windows.Controls.Control.GetBuiltInStyle(IntPtr nativeTarget, IntPtr& nativeStyle)    
--- End of inner exception stack trace ---    
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)    
at SpellCheckerSample.StandardSpellDialog.InitializeComponent()    
at SpellCheckerSample.StandardSpellDialog..ctor()}

我该如何调试?我怎么知道第 1739 行第 47 行在哪个文件中?

How can I debug this? How do I know what file line 1739, Position 47 is in?

推荐答案

原来我的具体问题是 ComponentOne 组件只能在 Silverlight 4 下工作.一旦我更改为目标 SL4,一切都有效.

Turns out my specific problem was that the ComponentOne component only works under Silverlight 4. Once I changed to target SL4 it all worked.

这篇关于如何调试 XamlParseException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆