Message: The name already exists in the tree:

5 posts, 0 answers
  1. Vuyiswa Maseko
    Vuyiswa Maseko avatar
    187 posts
    Member since:
    Jan 2010

    Posted 07 Apr 2011 Link to this post

     This is the most Strangest error i have ever received from Silverlight. I have each control with its own name and i just added a Link button and a Menu item , i did a copy and paste of other items and renamed them from the xaml and i added a page that will be used by that menu item and i compiled the app and when i run it i get the following Error
     
    Line: 54
    Error: Unhandled Error in Silverlight Application
    Code: 2028   
    Category: ParserError      
    Message: The name already exists in the tree: EchashDev.    
    File:     
    Line: 0    
    Position: 0
        
    i tried googling and a lot of people are have different scenario which might be different from mine. I am not sure why Silverlight does not point to a problem element.
    My xaml looks like this

    <UserControl
      x:Class="EchashDev.MainPage"
      xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
      xmlns:login="clr-namespace:EchashDev.LoginUI"
      xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
      xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
      xmlns:telerikTransitions="clr-namespace:Telerik.Windows.Controls.TransitionEffects;assembly=Telerik.Windows.Controls"
      xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
      mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="600" xmlns:my="clr-namespace:Telerik.ReportViewer.Silverlight;assembly=Telerik.ReportViewer.Silverlight">
        <telerik:RadBusyIndicator x:Name="busyIndicator" Grid.Row="1" BusyContent="Loading data....">
            <Grid x:Name="LayoutRoot" Background="#FFEFE5E5"  >
         
                <telerik:RadWrapPanel Height="76"    Name="radWrapPanel4" VerticalAlignment="Top">
                    <telerik:RadWrapPanel.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFBE814" Offset="0"/>
                            <GradientStop Color="#FFDA2003" Offset="1"/>
                            <GradientStop Color="#FFF1DE0A" Offset="0.5"/>
                        </LinearGradientBrush>
                    </telerik:RadWrapPanel.Background></telerik:RadWrapPanel>
                <telerik:RadWrapPanel HorizontalAlignment="Left" Margin="0,76,0,12" Name="radWrapPanel5" Width="134">
                    <telerik:RadWrapPanel.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF0F111" Offset="0"/>
                            <GradientStop Color="#FFFD0909" Offset="1"/>
                            <GradientStop Color="#FEF58C0D" Offset="0.464"/>
                        </LinearGradientBrush>
                    </telerik:RadWrapPanel.Background>
                    <telerikNavigation:RadMenu  telerik:StyleManager.Theme="Office_Blue"  Height="236" Name="radMenu1" Width="135"  Orientation="Vertical">
                        <telerikNavigation:RadMenu.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFF0F111" Offset="0"/>
                                <GradientStop Color="#FFFD7909" Offset="1"/>
                                <GradientStop Color="#FEFB971E" Offset="0.433"/>
                            </LinearGradientBrush>
                        </telerikNavigation:RadMenu.Background>
                        <telerikNavigation:RadMenuItem x:Name="itemcanteensolutions" Visibility="Collapsed"  Tag="Canteen Solutions">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton NavigateUri="/Tuckshop/CanteenSolutions" TargetName="MainFrame"  Content="Canteen Solutions" Foreground="Black"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem x:Name="itemlinkmykids" Visibility="Collapsed"  Tag="Link my Kids">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton NavigateUri="/Parent/LinkmyKids" TargetName="MainFrame" Content="Link my Kids" Foreground="Black"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem x:Name="itemuploadmoney"  Visibility="Collapsed" Tag="Upload Money">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton NavigateUri="/Parent/UploadMoney" TargetName="MainFrame" Content="Upload Money" Foreground="Black"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem x:Name="itemmealplan" Visibility="Collapsed" Tag="MealPlan">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton NavigateUri="/Parent/MealPlan" TargetName="MainFrame" Content="Meal Plan" Foreground="Black"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem x:Name="itemorderonline" Visibility="Collapsed" Tag="Order online">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton NavigateUri="/Tuckshop/Orderonline" TargetName="MainFrame" Content="Order Online" Tag="Orderonline" Foreground="Black"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem x:Name="itemMAllocator" Visibility="Collapsed" Tag="MAllocators">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton NavigateUri="/Parent/MAllocator"  TargetName="MainFrame" Content="Money Allocation" Tag="MAllocator" Foreground="Black"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem x:Name="itemAccount" Visibility="Collapsed" Tag="MyAccount">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton NavigateUri="/Parent/ParentAccounts" TargetName="MainFrame" Content="My Account" Tag="MyAccount" Foreground="Black"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem x:Name="itemTuckshopAccount" Visibility="Collapsed" Tag="TuckShopAccount">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton NavigateUri="/Tuckshop/TuckShopAccount" TargetName="MainFrame" Content="Tuck-Shop Account" Tag="TuckShopAccount" Foreground="Black"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem x:Name="itemcontactus"   Tag="Contact us">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton NavigateUri="/Contactus" TargetName="MainFrame" Content="Contact us" Tag="Contactus" Foreground="Black"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem x:Name="itemaboutus"  Tag="About us">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton NavigateUri="/About" TargetName="MainFrame" Content="About us" Tag="Aboutus" Foreground="Black"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem x:Name="itemlogout" Visibility="Collapsed"  Tag="Logout">
                            <telerikNavigation:RadMenuItem.Header>
                                <HyperlinkButton Click="HyperlinkButton_Click"  TargetName="MainFrame" Content="Logout"></HyperlinkButton>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                    </telerikNavigation:RadMenu>
                </telerik:RadWrapPanel>
                <telerik:RadWrapPanel DataContext="{Binding}" Height="16" HorizontalAlignment="Stretch"  Margin="0,464,0,0" Name="radWrapPanel2" OpacityMask="#FFC10C0C" VerticalAlignment="Bottom" >
                    <telerik:RadWrapPanel.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF0F111" Offset="0"/>
                            <GradientStop Color="#FEF58C0D" Offset="1"/>
                            <GradientStop Color="#FEF58C0D" Offset="0.472"/>
                        </LinearGradientBrush>
                    </telerik:RadWrapPanel.Background>
                    <Canvas Background="Transparent"></Canvas>
                    <sdk:Label Height="16" HorizontalAlignment="Center"  Content="Copyright © 2011 Ecash. All Rights Reserved. " />
                </telerik:RadWrapPanel>
                <telerik:RadBusyIndicator x:Name="busyIndicatorLoging" Grid.Row="1" BusyContent="Loging in....">
                <Canvas x:Name="LoginCanvas" Margin="0,76,0,16" HorizontalAlignment="Right" Width="210">
                    <Rectangle Height="194"  Width="10">
                        <Rectangle.Fill>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFFBC300" Offset="0"/>
                                <GradientStop Color="#FFC4856D" Offset="1"/>
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <TextBox Height="22" HorizontalAlignment="Right" x:Name="txtusername" VerticalAlignment="Top" Width="108" LostFocus="txtusername_LostFocus" Canvas.Left="80" Canvas.Top="26" />
                    <PasswordBox Height="22" HorizontalAlignment="Right" x:Name="txtpassword" TextOptions.TextHintingMode="Animated"   VerticalAlignment="Top" Width="108" LostFocus="txtpassword_LostFocus" Canvas.Left="80" Canvas.Top="59" />
                    <sdk:Label  Content="Username" Height="20" HorizontalAlignment="Right" x:Name="label1" VerticalAlignment="Top" Width="56" Canvas.Left="18" Canvas.Top="28" />
                    <sdk:Label Content="Password" Height="20" HorizontalAlignment="Right" x:Name="label2" VerticalAlignment="Top" Width="56" Canvas.Left="14" Canvas.Top="63" RenderTransformOrigin="1.089,0.75" />
                    <HyperlinkButton NavigateUri="/Login/ForgotPassword" TargetName="MainFrame" Content="Forgot Password"  Height="20" HorizontalAlignment="Right"   VerticalAlignment="Top" Width="98" Canvas.Left="18" Canvas.Top="97" Foreground="#FF111314"/>
                    <HyperlinkButton NavigateUri="/Login/Registration" TargetName="MainFrame" Content="Register"  Height="21"  HorizontalAlignment="Right"  VerticalAlignment="Top" Width="54" Canvas.Left="18" Canvas.Top="121" Foreground="#FF121314" RenderTransformOrigin="0.352,0.476"/>
                    <telerik:RadButton Content="Login" Height="25" HorizontalAlignment="Right" x:Name="btnlogin" VerticalAlignment="Top" Width="53" Click="btnlogin_Click" Canvas.Left="18" Canvas.Top="146" RenderTransformOrigin="1.038,0.52" />
                    <sdk:Label Canvas.Left="0" Foreground="White" Visibility="Collapsed" Background="Red" Canvas.Top="211" Height="25" x:Name="lblError" Width="210" BorderBrush="#FFFBC300" BorderThickness="2" />
                    <Rectangle Height="20" Stroke="Black" Canvas.Top="185" Width="210">
                        <Rectangle.Fill>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="Black" Offset="0"/>
                                <GradientStop Color="#FFF90909" Offset="1"/>
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <Canvas.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFEFE359" Offset="0" />
                            <GradientStop Color="#FFE83333" Offset="1" />
                        </LinearGradientBrush>
                    </Canvas.Background>
                </Canvas>
                </telerik:RadBusyIndicator>
                <Rectangle Height="181" x:Name="RightBar"  Width="11" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,80,0,0">
                    <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF7E30A" Offset="0"/>
                            <GradientStop Color="#FFC4856D" Offset="1"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
     
                <telerik:RadWrapPanel Height="Auto" Margin="133,76,216,20" Name="radWrapPanel1">
                 
                    <navigation:Frame x:Name="MainFrame" HorizontalAlignment="Stretch"    VerticalAlignment="Stretch" Margin="0,0,-28,-6" Width="Auto" Height="Auto" d:LayoutOverrides="HorizontalAlignment, VerticalAlignment">
                        <navigation:Frame.Template>
                            <ControlTemplate TargetType="navigation:Frame">
                                <telerik:RadTransitionControl x:Name="PART_FrameCP" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}">
                                    <telerik:RadTransitionControl.Transition>
                                        <telerik:PerspectiveRotationTransition></telerik:PerspectiveRotationTransition>
                                    </telerik:RadTransitionControl.Transition>
                                </telerik:RadTransitionControl>
     
                            </ControlTemplate>
                        </navigation:Frame.Template>
                        <navigation:Frame.UriMapper>
                            <uriMapper:UriMapper>
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml" />
     
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/MealPlan.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml" />
                                 
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/Registration.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/Login/{pageName}.xaml" />
     
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/Login/ForgotPassword.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/Login/{pageName}.xaml" />
     
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/Parent/LinkmyKids.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/Parent/{pageName}.xaml" />
     
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/About.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml" />
     
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/Parent/ParentAccounts.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml" />
     
     
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/Tuckshop/TuckShopAccount.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml" />
     
     
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/Parent/MoneyAllocator.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml" />
                                 
     
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/ConfirmationPages/ConfirmRecoverCredentials.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/ConfirmationPages/{pageName}.xaml" />
     
                                <uriMapper:UriMapping Uri="" MappedUri="/Views/Login/NoAuthorization.xaml.xaml" />
                                <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/NoAuthorization/{pageName}.xaml" />
     
                            </uriMapper:UriMapper>
                        </navigation:Frame.UriMapper>
                    </navigation:Frame>
                </telerik:RadWrapPanel>
                <Rectangle Height="20" Stroke="Black" x:Name="TopBar" Width="210" HorizontalAlignment="Right" Margin="0,76,0,0" VerticalAlignment="Top">
                    <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="Black" Offset="0"/>
                            <GradientStop Color="#FFF90909" Offset="1"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
                  
            </Grid>
        </telerik:RadBusyIndicator>
    </UserControl>

    Thanks 
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 07 Apr 2011 Link to this post

    Hello Vuyiswa Maseko,

    How exactly is your problem related to Telerik controls?

    Greetings,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Vuyiswa Maseko
    Vuyiswa Maseko avatar
    187 posts
    Member since:
    Jan 2010

    Posted 07 Apr 2011 Link to this post

    This happened after i copy and pasted the items of the Radmenu control.
  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 07 Apr 2011 Link to this post

    Hello Vuyiswa Maseko,

    The error indicates that there are two items with the same name in the tree. We really can't tell anything more than that. Try to start with a blank page and then gradually add stuff and run the project each time you add something -- in this way you will find out what element is causing your exception.

    All the best,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Vuyiswa Maseko
    Vuyiswa Maseko avatar
    187 posts
    Member since:
    Jan 2010

    Posted 07 Apr 2011 Link to this post

    i Had two Projects, opened. i was doing my demo on one project , so they liked it and i copy and paste from one project to another and it created a reference and now it means the control exists in tow projects are are linked so it caused a Conflict, its a lesson , dont copy controls between projects unless you copy code.
Back to Top
DevCraft banner