Windows XP 上的 XamlParseException [英] XamlParseException on Windows XP
本文介绍了Windows XP 上的 XamlParseException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 WPF 应用程序,它在 vista/7 上运行得非常好,但在 Windows XP 上它抛出了 System.Windows.Markup.XamlParse 错误,这很令人沮丧,因为我的应用程序中有很多控件我不知道是什么导致了问题.
I have a WPF application which runs perfectly fine on vista/7 but on Windows XP it chucks up the System.Windows.Markup.XamlParse error, and it's quite frustrating because I have a hell of a lot of controls in my application and I don't know what is causing the problem.
有人能在这里发光吗?
推荐答案
就我而言,我不得不更改 Image 元素的来源.它有 ico 文件,但 XP 不能将其作为此类元素的源.
In my case I had to change Source of Image element. It has ico file, but XP cannot have it as source for this type of element.
<Image Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Width="48" Height="48" VerticalAlignment="Center"
Source="Resources/Images/favicon.ico" />
我不得不将其更改为并制作特定的 PNG 文件
I had to change it to and make 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" />
我的错误是:
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)
这篇关于Windows XP 上的 XamlParseException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文