why is there a Windows.UI.Xaml.Markup.XamlParseException occor?

Answered why is there a Windows.UI.Xaml.Markup.XamlParseException occor?

  • Wednesday, May 16, 2012 10:13 AM
     
      Has Code

    i use a grid with two columns and the left column is a statckpanel.

    in the ide preview window it shows normal,but when i run it ,it gives a exception says

    A first chance exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in UI.DLL.

    the xaml code is following

    <StackPanel x:Name="left" Grid.Column="0" Background="DarkSeaGreen" Margin="20,0,0,0">
                    <StackPanel Orientation="Horizontal" Background="LightGray">
                        <HyperlinkButton Content="图书" Foreground="Black" Padding="0"/>
                        <TextBlock Text=">" VerticalAlignment="Center" Margin="5"/>
                        <HyperlinkButton Content="小说" Foreground="Black" Padding="0"/>
                    </StackPanel>
                    <Image Source="\Assets\11.png" Stretch="None" HorizontalAlignment="Left"/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="★"/>
                        <TextBlock Text="★"/>
                        <TextBlock Text="★"/>
                        <TextBlock Text="★"/>
                        <TextBlock Text="★"/>
                    </StackPanel>
                    <TextBlock Text="作者" VerticalAlignment="Bottom" Margin="10,0,0,20"/>
                </StackPanel>
    help me please.


    • Edited by waot Wednesday, May 16, 2012 10:18 AM
    •  

All Replies

  • Wednesday, May 16, 2012 11:34 AM
     
     Answered Has Code

    Replace

                <Image Source="\Assets\11.png"
    

    with

                <Image Source="/Assets/11.png"
    

    Note the foward slashes.

    http://babaandthepigman.spaces.live.com/blog/

    • Marked As Answer by waot Thursday, May 17, 2012 12:55 AM
    •  
  • Thursday, May 17, 2012 12:58 AM
     
     

    oh my..! the problem takes me two hours..

    thanks a lot.

  • Wednesday, July 25, 2012 2:43 AM
     
     
    Thanks for the solution. I jumped into same issue, using forward slashes fixed it.