locked
Error: The tag does not exist in XML namespace ... RRS feed

  • Question

  • Greetings,

    All of the sudden I get this error whenever I try to build my Silverlight 4 Business Application:

    The tag 'DatePicker' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk'.

    And here is an example of the code where the error occurs (in all Views where I use the DataPicker):

    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
    <toolkit:DataField Label="Meeting Date" HorizontalAlignment="Left" Margin="3,3,0,3">
        <sdk:DatePicker SelectedDate="{Binding Path=MeetingDT, Mode=TwoWay}" Width="103" />
    </toolkit:DataField>
    
    Friday, August 5, 2011 9:01 PM

Answers

  • Hi,

    Please check the property of System.Windows.Controls at "References" folder of your Silverlight project it should be C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Libraries\Client\System.Windows.Controls.dll or C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Windows.Controls.dll, normally is automatically inserted when we drag DatePicker control.

    Try to remove System.Windows.Controls from "References" folder and remove DatePicker control, and then drag (do not type) DataPicker from Silverlight ToolBox

    Jannen

    Friday, August 5, 2011 10:26 PM

All replies

  • Hi,

    I found no wrong with your code. Here my test:

    <navigation:Page 
        x:Class="OurPlanet.Views.SecondPage" 
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
        d:DesignWidth="640" d:DesignHeight="480"
        Title="SecondPage Page" 
        xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
        xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">
        <Grid x:Name="LayoutRoot">
            <toolkit:DataField HorizontalAlignment="Left" Margin="66,225,0,0" Name="dataField1" VerticalAlignment="Top" Width="182" >
                <sdk:DatePicker Height="23" HorizontalAlignment="Left" Margin="0" Name="datePicker1" VerticalAlignment="Top" Width="120" />
            </toolkit:DataField>
        </Grid>
    </navigation:Page>

    Everything fine. My sugestion, remove one DataField control and one DatePicker control, and reaplly from toolBox to refresh reference to that control.

    Have fun

    Jannen

    Friday, August 5, 2011 9:15 PM
  • Jannen,

    Thanks for your help on this.

    I am wondering if I lost a reference to the "sdk" namespace and if so how to fix it.

    I did what you said and tried dragging a DatePicker control from the toolbox to my DataForm and it works but is prefixed with the "controls" namespace as below:

    xmlns:controls="clr-namespace:System.Windows.Controls;
    <controls:DatePicker />
    Friday, August 5, 2011 9:56 PM
  • Hi,

    Please check the property of System.Windows.Controls at "References" folder of your Silverlight project it should be C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Libraries\Client\System.Windows.Controls.dll or C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Windows.Controls.dll, normally is automatically inserted when we drag DatePicker control.

    Try to remove System.Windows.Controls from "References" folder and remove DatePicker control, and then drag (do not type) DataPicker from Silverlight ToolBox

    Jannen

    Friday, August 5, 2011 10:26 PM
  • I found the problem. 

    I had added a third party spellchecker component to my project and it changed the assembly references to look at a different physical folder for the DatePicker, TabControl and TabItem controls.

    I removed the reference to the third party spellchecker  and the control references reverted back to the correct dll references.

    Friday, August 5, 2011 11:35 PM
  • It was my supicious, and the last reply was to make DatePicker to the right reference

    By the way, it's glad this case is solved.

    Have fun,

    Jannen 

    Friday, August 5, 2011 11:45 PM
  • Hi!

    Could please close the case by Mark As Answer

    Regards,

    Jannen

    Saturday, August 6, 2011 6:19 AM
  • Jannen,

    I had downloaded a third party control to use in my project. Among the files in that folder was a System.Windows.Controls.dll for some reason.  When I referenced another file in that folder, VS automaticaly attached come controls in my project to that dll. I deleted that dll and the controls defaulted back to the original dll: 

    xmlns:sdk=http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk

    Thanks again for your help.

    Monday, August 8, 2011 9:47 AM
  • Thanks for the info Todd, I think I downloaded that same spellchecker (RapidSpell?) and ran into the same problem you had.

    Friday, October 14, 2011 6:10 PM