6

My WPF application is running fine on Windows 7. Installation on XP machine brings up the following error on startup:

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: System.Windows.Markup.XamlParseException

Stack: at System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)

at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)

at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)

at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)

at System.Windows.Application.LoadComponent(System.Object, System.Uri)

at MyApplication.App.InitializeComponent()

at MyApplication.App.Main()

I think I may be experiencing the problem described in the answer to this question:

XamlParseException on Windows XP

as I am using PresentationFramework.Aero in places. Is there a way to fix this or will I have to remove Aero? This is a pain as I am using some ButtonChromes

TIA

Community
  • 1
  • 1
Sam S
  • 61
  • 1
  • 1
  • 4
  • i am having the exact same problem, have you found a solution that you can post an answer to your question? – KMC Oct 18 '11 at 10:53

4 Answers4

6

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".

Felix
  • 61
  • 1
  • 2
1

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" />
Simon
  • 1,211
  • 9
  • 5
0

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

Jeff McClintock
  • 1,242
  • 10
  • 27
  • the original link is rotten, read it here: http://web.archive.org/web/20120623034740/http://support.microsoft.com/kb/968227 – trogper May 06 '21 at 17:59
0
  • 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.

Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689