tags:

views:

536

answers:

2

When I try using a Name="id" and\or x:name="id" I get a compiler error:

The Type 'MyName' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

When I don't have this specified my control runs just fine. Any suggestions?

A: 

I've run into this before and believe it's a compiler bug. I ended up just sticking a named ContentControl in my XAML and sticking the user control in it from the code behind. Hopefully someone can share an actual fix for this.

Kent Boogaart
+1  A: 

Well, first of all the right syntax is x:Name, although Name by itself usually (but not always) works too.

Does the x:Class on your root-level element match the name (and namespace!) of your code-behind file? I know that some versions of Blend and VS didn't insert the default namespace correctly, and of course if you've changed it from the default you'll need to make sure you've changed the other file as well.

Miral