【发布时间】:2015-07-17 01:22:24
【问题描述】:
我在一个非常简单的 wpf 应用程序中正确设置了 xaml 代码或属性窗口中的窗口图标属性,但 Visual Studio 总是在运行时抛出 XamlParseException。为什么会这样?(使用visual studio 2013和windows 8,我的图标大小是15 KB)
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" Icon="pack://siteoforigin:,,,/Resources/MyIcon.ico">
<Grid>
</Grid> </Window>
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" Icon="/Resources/MyIcon.ico">
<Grid>
</Grid> </Window>
【问题讨论】:
-
都是 XAML 代码吗?结束的 标签在哪里?
-
@rufanov 抱歉我在这里错过了
-
有什么异常?
-
@Ganesh XamlParseException
-
是否有任何内部异常?