-2

I have a solution named Solution1, which has multiple projects named Project1, Project2 etc. In Project1, I have a usercontrol called "DesignElement". When I name the UserControl from the XAML, using the "x:Name" and then compile it, i get the following compile error:

"The type or namespace name 'Project2 ' does not exist in the namespace 'Solution1.Project1.Project2' (are you missing an assembly reference?)"

Where is this reference of Project2 coming in Project1? Why does this compile error arise? Also, if I am not going to use the "x:Name" in any controls, then the solution compiles and runs fine. Any help on the same is appreciated.

Sangeetha
  • 485
  • 2
  • 9
  • 24

1 Answers1

0

Just because you have two projects in the same solution doesn't mean that they can instantly see each other.

Here is the proper flow to making them see each other

  1. Create a solution
  2. Add projects
  3. In project two right click on references in Solution Explorer and hit add reference

    ^^^^^this is the step you missed^^^^

  4. In the collumn on the left of the popup click solution
  5. Choose project one
  6. Add using or xmlns in your code to project one
  7. reference project one's code
DotNetRussell
  • 9,716
  • 10
  • 56
  • 111
  • I dont want the projects to see each other, but when i name the controls, it automatically searches for the other project, which is not required. – Sangeetha Jun 09 '14 at 07:50