Tag Archives: silverlighterror

Silverlight “Name ‘InitializeComponent’ is not declared”

Standard

She'd be far less frutrated if she plugged it into the network first.

It is quite common in Webforms, Winforms and other environements to copy user interface views from one project to another.

When you copy xaml files from one Silverlight project to another you may experience the error:

“Name ‘InitializeComponent’ is not declared”

 

This happens because the “x:Class” directive in the top of the xaml file includes the project namespace.

So, open up your xaml file, and change this:

 

x:Class=”PreviousProject.YourClass”

 

To the new project namespace:

x:Class=”NewProject.YourClass”

 

Oh and BTW…..ITS CASE SENSITIVE! 

 

I know this isn’t much of a post, but hopefully it will provide a useful search engine hit for the desperate.

Advertisements