Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The name XXX does not exist in the namespace YYY (XAML VS12 Windows 8)

Tags:

xaml

So I'm working in VS12 on Windows 8, and hacking the ContosoCookbook code to make a different app. I'm trying to set up a "MainMenu.xaml" page and in I have:

        <CollectionViewSource
        x:Name="groupedItemsViewSource"
        Source="{Binding Groups}"
        IsSourceGrouped="true"
        ItemsPath="TopItems"
        d:Source="{Binding AllGroups, Source={d:DesignInstance Type=data:FlashCardDataSource, IsDesignTimeCreatable=True}}"/>

The error I'm getting is: The name "FlashCardDataSource" does not exist in the namespace "using:FlashCards.Data".

...but I don't understand how it doesn't. Where do I start looking? I'm new at XAML.

-Ken

like image 276
Ken Cone Avatar asked Aug 30 '12 02:08

Ken Cone


3 Answers

If nothing else is possible, comment the lines which use the namespace, rebuild, and then build the full project again.

I also tried rebuilding the project, reopening Visual Studio. Nothing helped. I finally commented xaml, rebuilt the project, uncommented xaml and it finally worked! Strange issue.

like image 63
Maxiss Avatar answered Nov 01 '22 02:11

Maxiss


If cleaning and rebuilding does not help, try restarting Visual Studio. Worked for me.

like image 13
ApoorvaJ Avatar answered Nov 01 '22 03:11

ApoorvaJ


Generally this error is caused by one of the following:

  1. You haven't referenced the assembly that the class is in.
  2. You haven't updated the reference to the assembly after adding the class to it.
  3. You are referencing the wrong version of the assembly.
  4. You are referencing the .DLL file instead of the project (in the case where the project is part of your solution)
  5. There is a syntax error in the class you are referencing.
like image 5
Captain Kenpachi Avatar answered Nov 01 '22 04:11

Captain Kenpachi