locked
Xaml Parse Exception Error RRS feed

  • Question

  • Hi,

    What am I suppose to do to know what's wrong when I get the error XamlParseException [Line : 0, Position 0] and the UserControl tag is underscored in red in the xaml ? The project is build without any error, runs fune in VS 2010 but as soon as I load the project in Blend 4 and the MainPage appears, if I just start to intereact, just zooming for instence,  it creashes with the XamlParseException.  But I really don't know where is the problem !!!

    I would like to know where is the problem but it reports an exception at line 0 position 0.  This doesn't give me any information and the Inner Exception is none.  So nothing to help me out.  Any support please ?

    Wednesday, January 5, 2011 2:51 PM

All replies

  • Could you post the xaml here?
    Wednesday, January 5, 2011 3:46 PM
    Moderator
  • <UserControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:esriToolkit="clr-namespace:ESRI.ArcGIS.Client.Toolkit;assembly=ESRI.ArcGIS.Client.Toolkit"
        xmlns:userControls="clr-namespace:CrashViewer.Client.Controls"
        xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
        xmlns:esriSymbols="clr-namespace:ESRI.ArcGIS.Client.Symbols;assembly=ESRI.ArcGIS.Client"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
        xmlns:tk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
        xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
        xmlns:local="clr-namespace:MapTipPosition"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:floatableWindow="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.FloatableWindow"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        x:Class="CrashViewer.Client.MainPage" MouseMove="UserControl_MouseMove" KeyDown="UserControl_KeyDown">

        <UserControl.Resources>
            <Storyboard x:Name="sbLegendShow">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="gdLegend" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="315"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Name="sbLegendHide">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="gdLegend" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
        </UserControl.Resources>

        <tk:BusyIndicator x:Name="biDoingWork">
            <tk:BusyIndicator.BusyContent>
                <TextBlock x:Name="txtBusyMessage" FontSize="15" />
            </tk:BusyIndicator.BusyContent>

            <!-- ALL PAGE CONTENT IS INSIDE BUSY INDICATOR TO PREVENT MULTIPLE CONCURRENT CALLS TO QUERY SERVICES -->
            <Grid x:Name="LayoutRoot" ShowGridLines="False" SizeChanged="LayoutRoot_SizeChanged">
                <Grid.Resources>
                    <esriSymbols:SimpleFillSymbol x:Name="DefaultFillSymbol" Fill="#33FF0000" BorderBrush="Red" BorderThickness="2" />
                    <esriSymbols:SimpleMarkerSymbol x:Name="UnselectedFillSymbol" Color="Red" Size="15" Style="Circle" />
                </Grid.Resources>

                <Grid.RowDefinitions>
                    <RowDefinition Height="34" />
                    <RowDefinition />
                </Grid.RowDefinitions>

                <esri:Map x:Name="MainMap" Grid.Row="0" Grid.RowSpan="2" IsLogoVisible="False" Background="White"
                          Extent="821157.81167616, 1967050.41388726, 1098475.54615864, 2147033.10870848"
                          ExtentChanged="MainMap_ExtentChanged"  >
                    <i:Interaction.Behaviors>
                        <local:PositionMapTip />
                    </i:Interaction.Behaviors>
                    <esri:Map.Layers>

                        <!-- street -->
                        <esri:ArcGISTiledMapServiceLayer x:Name="lyrBaseMap_street" ID="basemap_street" Visible="True"
                                                     Url="http://gis.mchenrycountygis.org/ArcGIS/rest/services/basemap/MapServer"
                                                     InitializationFailed="AllMapLayers_InitializationFailed"
                                                     Initialized="AllMapLayers_Initialized" />
                        <!--<esri:ArcGISDynamicMapServiceLayer x:Name="lyrBaseMap_street" ID="basemap_street" Visible="True"
                                                     Url="http://mcgcgisdev/ArcGIS/rest/services/basemapdyn/MapServer"
                                                     InitializationFailed="AllMapLayers_InitializationFailed"
                                                     Initialized="AllMapLayers_Initialized" />-->
                        <esri:ArcGISTiledMapServiceLayer x:Name="lyrCenterlines_street" ID="centerlines_street" Visible="True"
                                                       Url="http://gis.mchenrycountygis.org/ArcGIS/rest/services/mcdotroadcenterlines/MapServer"
                                                       InitializationFailed="AllMapLayers_InitializationFailed"
                                                       Initialized="AllMapLayers_Initialized" />
                        <esri:ArcGISTiledMapServiceLayer x:Name="lyrAerials_2008aerial" ID="aerials_2008aerial" Visible="False"
                                                     Url="http://gis.mchenrycountygis.org/ArcGIS/rest/services/2008aerials/MapServer"
                                                     InitializationFailed="AllMapLayers_InitializationFailed"
                                                     Initialized="AllMapLayers_Initialized" />
                        <esri:ArcGISTiledMapServiceLayer x:Name="lyrAerials_2005aerial" ID="aerials_2005aerial" Visible="False"
                                                     Url="http://gis.mchenrycountygis.org/ArcGIS/rest/services/2005aerials/MapServer"
                                                     InitializationFailed="AllMapLayers_InitializationFailed"
                                                     Initialized="AllMapLayers_Initialized" />
                        <esri:ArcGISTiledMapServiceLayer x:Name="lyrAerialOverlay_aerial" ID="aerialoverlay_aerial" Visible="False"
                                                     Url="http://gis.mchenrycountygis.org/ArcGIS/rest/services/mcdotaerialoverlay/MapServer"
                                                     InitializationFailed="AllMapLayers_InitializationFailed"
                                                     Initialized="AllMapLayers_Initialized" />
                        <esri:GraphicsLayer x:Name="lyrGraphics" ID="Graphics" Initialized="lyrGraphics_Initialized">
                            <esri:GraphicsLayer.MapTip>
                                <Grid esri:GraphicsLayer.MapTipHideDelay="00:00:01">
                                    <userControls:MapTip x:Name="uxMapTip"/>
                                </Grid>
                            </esri:GraphicsLayer.MapTip>
                        </esri:GraphicsLayer>
                    </esri:Map.Layers>
                </esri:Map>

                <esriToolkit:Navigation x:Name="MyNavigation" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="8" />

                <Border BorderBrush="Silver" BorderThickness="0,0,0,1" Grid.Row="0">
                    <Grid x:Name="gdToolbar">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="150" />
                            <ColumnDefinition Width="5" />
                        </Grid.ColumnDefinitions>
                        <Grid.Background>
                            <SolidColorBrush Color="#FF4B4A4A" Opacity="0.8" />
                        </Grid.Background>
                        <TextBlock x:Name="lblMastHead" Text="Crash Viewer" Margin="3,0,0,0" Style="{StaticResource MastHead}" Grid.Column="0" />
                        <!--<TextBlock x:Name="lblMastHead" Text="McHenry County" Margin="3,0,0,0" Style="{StaticResource MastHead2}" Grid.Column="0" />-->
                        <TextBlock x:Name="lblMastHead2" Text="McHenry County" Margin="3,16,0,0" Style="{StaticResource MastHead2}" Grid.Column="0" />
                        <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Center">
                            <Button x:Name="btnToolBarFind" Width="28" Height="28" Margin="4,2" Background="Transparent" Click="btnToolBarFind_Click"
                                ToolTipService.ToolTip="Search" Template="{StaticResource ToolbarSearch}" Visibility="Collapsed"/>
                            <Button x:Name="btnToolBarSelect" Width="28" Height="28" Margin="4,2" Background="Transparent" Click="btnToolBarSelect_Click"
                                ToolTipService.ToolTip="Select/Unselect Crashes" Template="{StaticResource ToolbarSelect}" Visibility="Collapsed" />
                            <Button x:Name="btnToolBarTable" Width="28" Height="28" Margin="4,2" Background="Transparent" Click="btnToolBarTable_Click"
                                ToolTipService.ToolTip="Hide Result Table" Template="{StaticResource ToolbarTable}" Visibility="Collapsed" />
                            <Button x:Name="btnToolBarClear" Width="28" Height="28" Margin="4,2" Background="Transparent" Click="btnToolBarClear_Click"
                                ToolTipService.ToolTip="Clear Crashes" Template="{StaticResource ToolbarClear}" Visibility="Collapsed"/>
                            <Button x:Name="btnToolbarZoomIn" Width="28" Height="28" Margin="4,2"
                                Background="Transparent" Click="btnToolbarZoomIn_Click" ToolTipService.ToolTip="Zoom In"
                                Template="{StaticResource ToolbarZoomIn}" />
                            <Button x:Name="btnToolbarZoomOut" Width="28" Height="28" Margin="4,2"
                                Background="Transparent" Click="btnToolbarZoomOut_Click" ToolTipService.ToolTip="Zoom Out"
                                Template="{StaticResource ToolbarZoomOut}" />
                            <Button x:Name="btnToolbarPan" Width="28" Height="28" Margin="4,2"
                                Background="Transparent" Click="btnToolbarPan_Click" ToolTipService.ToolTip="Pan"
                                Template="{StaticResource ToolbarPan}" />
                            <Button x:Name="btnToolbarPreviousExtent" Width="28" Height="28" Margin="4,2" IsHitTestVisible="False"
                                Background="Transparent" Click="btnToolbarPreviousExtent_Click" ToolTipService.ToolTip="Previous Extent"
                                Template="{StaticResource ToolbarPreviousExtent}" />
                            <Button x:Name="btnToolbarNextExtent" Width="28" Height="28" Margin="4,2" IsHitTestVisible="False"
                                Background="Transparent" Click="btnToolbarNextExtent_Click" ToolTipService.ToolTip="Next Extent"
                                Template="{StaticResource ToolbarNextExtent}" />
                            <Button x:Name="btnToolbarFullExtent" Width="28" Height="28" Margin="4,2"
                                Background="Transparent" Click="btnToolbarFullExtent_Click" ToolTipService.ToolTip="Full Extent"
                                Template="{StaticResource ToolbarFullExtent}" />
                            <Button x:Name="btnToolbarFullScreen" Width="28" Height="28" Margin="4,2"
                                Background="Transparent" Click="btnToolbarFullScreen_Click" ToolTipService.ToolTip="Full Screen"
                                Template="{StaticResource ToolbarFullScreen}" />
                            <!--<Button x:Name="btnToolbarPrint" Width="28" Height="28" Margin="4,2"
                                Background="Transparent" Click="btnToolbarPrint_Click"  ToolTipService.ToolTip="Print Map"
                                Template="{StaticResource ToolbarPrint}" />-->
                            <TextBlock x:Name="lblCurrentTool" Margin="5,0,0,0"  Style="{StaticResource QueryControlLabel}" Text="Current Tool: Pan" VerticalAlignment="Center" />
                            <Button x:Name="btnContactUs" Content="Contact Us" Margin="4,2" Style="{StaticResource TextOnlyButtonTemplate}" Click="btnContactUs_Click" ToolTipService.ToolTip="Contact Us" Visibility="Collapsed" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Grid.Column="2" HorizontalAlignment="Right">
                            <TextBlock x:Name="tbWelcome" Margin="5,0,0,0"  Style="{StaticResource QueryControlLabel}" VerticalAlignment="Center" Visibility="Collapsed"/>
                            <Button x:Name="btnLogin" Content="Login" Margin="10,0,0,0" Style="{StaticResource TextOnlyButtonTemplate}" Click="btnLogin_Click" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Grid.Column="3" HorizontalAlignment="Right" >
                            <Button x:Name="btnToggleMapLegend" Content="Hide Map Legend" Style="{StaticResource TextOnlyButtonTemplate}" Click="btnToggleMapLegend_Click" Visibility="Collapsed"/>
                        </StackPanel>
                    </Grid>
                </Border>

                <StackPanel x:Name="spShow" Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top" Visibility="Collapsed">
                    <Button x:Name="btnShowMap" Height="23" Width="75" Margin="4,2" FontWeight="Bold" Background="Transparent" Click="btnShowMap_Click" Content="Street" />
                    <Button x:Name="btnShow2008Aerial" Height="23" Width="75" Margin="4,2" Background="Transparent" Click="btnShow2008Aerial_Click" Content="2008 Aerial" />
                    <Button x:Name="btnShow2005Aerial" Height="23" Width="75" Margin="4,2" Background="Transparent" Click="btnShow2005Aerial_Click" Content="2005 Aerial" />
                </StackPanel>
                <Grid x:Name="gdLegend" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,35,5,0" Height="300" Visibility="Collapsed">
                    <userControls:Legend x:Name="uxLegend"/>
                </Grid>
                <!--<Image x:Name="imgLogo" Grid.Row="1" Source="images/dotlogo.png" Opacity="0.5" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5" Width="100" Height="101"/>-->
                <Grid x:Name="gdQueryPanel" Grid.Row="1" ShowGridLines="False">
                    <Grid.Resources>
                        <Storyboard x:Name="sbOpenSearchPanel">
                            <DoubleAnimation Storyboard.TargetName="gdSearchPanel"
                                                 Storyboard.TargetProperty="Height"
                                                 From="0" To="520" Duration="0:0:0.5" />
                            <DoubleAnimation Storyboard.TargetName="gdSearchPanel"
                                                 Storyboard.TargetProperty="Opacity"
                                                 From="0" To="1" Duration="0:0:0.5" />
                        </Storyboard>
                        <Storyboard x:Name="sbCloseSearchPanel">
                            <DoubleAnimation Storyboard.TargetName="gdSearchPanel"
                                                 Storyboard.TargetProperty="Height"
                                                 From="520" To="0" Duration="0:0:0.5" />
                            <DoubleAnimation Storyboard.TargetName="gdSearchPanel"
                                                 Storyboard.TargetProperty="Opacity"
                                                 From="1" To="0" Duration="0:0:0.5" />
                        </Storyboard>
                        <!--<Storyboard x:Name="sbExpandSearchPanel">
                            <DoubleAnimation Storyboard.TargetName="gdSearchPanel"
                                                 Storyboard.TargetProperty="Height"
                                                 From="0" To="630" Duration="0:0:0.5" />
                            <DoubleAnimation Storyboard.TargetName="gdSearchPanel"
                                                 Storyboard.TargetProperty="Opacity"
                                                 From="1" To="0" Duration="0:0:0.5" />
                        </Storyboard>
                        <Storyboard x:Name="sbCollapseSearchPanel">
                            <DoubleAnimation Storyboard.TargetName="gdSearchPanel"
                                                 Storyboard.TargetProperty="Height"
                                                 From="630" To="520" Duration="0:0:0.5" />
                            <DoubleAnimation Storyboard.TargetName="gdSearchPanel"
                                                 Storyboard.TargetProperty="Opacity"
                                                 From="1" To="0" Duration="0:0:0.5" />
                        </Storyboard>-->
                    </Grid.Resources>

                    <Grid x:Name="gdSearchPanel" HorizontalAlignment="Center" VerticalAlignment="Top" Height="0" Width="360">
                        <userControls:Search x:Name="uxSearch"/>
                    </Grid>
                </Grid>

                <!--<floatableWindow:FloatableWindow x:Name="fwPrintOption" Background="#66000000" Width="200" Height="200" Opacity="0.85"
                                    VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="0" Grid.RowSpan="2"
                                    Visibility="Collapsed"  Closing="flPrintOptions_Closing">
                    <userControls:PrintOption x:Name="uxPrintOption"/>
                </floatableWindow:FloatableWindow>-->

                <floatableWindow:FloatableWindow x:Name="fwResult" Title="Crash Results" 
                                    Grid.Row="0" Grid.RowSpan="2" ResizeMode="CanMinimize"
                                    Visibility="Collapsed" Margin="0,0,0,20" HorizontalAlignment="Center" VerticalAlignment="Bottom"
                                    Closing="flResult_Closing" SizeChanged="fwResult_SizeChanged">
                    <floatableWindow:FloatableWindow.Effect>
                        <DropShadowEffect Color="Gray" ShadowDepth="10" Opacity="0.5"/>
                    </floatableWindow:FloatableWindow.Effect>
                    <userControls:Result x:Name="uxResult"/>
                </floatableWindow:FloatableWindow>
            </Grid>
        </tk:BusyIndicator>
    </UserControl>

    Friday, January 7, 2011 6:41 PM
  • Check this link http://silverlight.codeplex.com/workitem/4958 I have the same problem.
    Friday, February 4, 2011 12:10 AM