XamlParseException in WPF application - but only on when installed on XP

╄→гoц情女王★ 提交于 2019-12-01 17:06:29

I had the same problem on Windows XP SP3 and for me the problem was solved by setting the "Copy Local" property of the PresentationFramework.Aero reference to "True".

When referring to the ResourceDictionary for Aero, try specifying the full assembly name, not the short assembly name.

<ResourceDictionary Source="/PresentationFramework.Aero, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />
  • Make sure there are no exceptions being thrown in the constructors for any of the UI components (such as codebehind for .cs files).
  • Make sure if you're using MVVM that you're not throwing any exceptions in the ViewModel constructor.

I had a view model throwing an exception (related to a COM component [which I'm now going to go track down!]) that had NOTHING to do with Xaml at all. You'll get a XamlParseException if the creation of a Xaml based component fails - and it can be misleading.

FIX: An exception in the XAML parser is thrown when you run a WPF application on a computer that has customized English (United States) regional settings.

http://support.microsoft.com/kb/968227

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