views:

58

answers:

3

Need some help with a typically vague Visual Studio 2008 error.

Error:

Error 3 The type or namespace name 'Label' does not exist in the namespace 'System.Windows.Controls' (are you missing an assembly reference?)

Relevant code:

internal System.Windows.Controls.Label DescriptionLabel;

I believe it's something to do with Silverlight, but i have the SDK for Silverlight 3 installed from here http://silverlight.codeplex.com/releases/view/36060. Using Windows 7 x64 and Visual Studio 2008 SP1.

I am not missing any assembly references in any projects as far as I can tell.

+1  A: 

Make sure you referenced the System.Windows.Controls.Data.Input.dll assembly in your project.

Simon Mourier
@Simon: I have this referenced in the project
Brock Woolf
+1  A: 

I'd recommend taking a look here: http://stackoverflow.com/questions/2429420/is-there-no-label-control-in-silverlight

Seems that if you're targeting SL2 there is no Label control, and if you're targeting SL3 you need to download the toolkit.

Brian Driscoll
I have the SL3 toolkit installed. Weird but the error still appears
Brock Woolf
+2  A: 

It seems that Microsoft have removed label or its been renamed in Silverlight 3. I was under the assumption that the project needed Silverlight 3, but in fact it uses Silverlight 2.

Installing Silverlight 2 Toolkit March 2009 solved the problem.

Brock Woolf
+1 for solving your own problem
Brian Driscoll