XamlParseException on Windows XP

I have a WPF application that works fine on vista / 7, but on Windows XP it causes a System.Windows.Markup.XamlParse error, and this is pretty annoying because there are a lot of controls in my application and I don’t know what causes a problem.

Can anyone shine here?

+2
source share
2 answers

In my case, I had to change the Source Image . It has an ico file, but XP cannot have it as a source for this element type.

<Image Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Width="48" Height="48" VerticalAlignment="Center" Source="Resources/Images/favicon.ico" /> 

I had to change it and make a specific PNG file

 <Image Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Width="48" Height="48" VerticalAlignment="Center" Source="Resources/Images/favicon-256.png" /> 

My mistake:

  Exception: Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception. PresentationFramework at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) 
+1
source

This is often caused by one of your control templates using something from the PresentationFramework.Aero assembly. This can happen if you modify templates using the "Edit Copy" in Blend. This will create a XAML copy of the currently active template for the system theme under which Blend is running. In the case of Vista or Win7, Aero is the default (Classic for XP). Many default Aero templates contain custom elements (ButtonChrome, etc.) that are related to the Aero theme and are declared in the Aero assembly. When running on XP, Aero builds are usually unavailable, so you lose links in XAML at runtime.

Do a text search throughout your solution for "PresentationFramework.Aero" and you should find some xmlns declarations using it.

+1
source

Source: https://habr.com/ru/post/888433/


All Articles