Designer Issue in Silverlight

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

I found a very "funny" issue in Silverlight, which cause designer to stop working. Because, such things make me crazy, hope this post will help you save you time.
If you have a page with some custom user control, which works properly, but designed doesn't want to show it in preview mode, try to llo for following error:

Error    2    Unknown namespace clr-namespace:Daenet.Xy.Controls;assembly=MyNamespace.MyControl;assembly=MyAssembly. [Line: 170 Position: 63]    X:\\FieldDetailViewControl.xaml    39    17    MyAssembly

Note, that this error doesn't appear in output window, which is not another silvering problem (out of scope).
So, the bad on this error is that it doesn't say anything useful. Moreover it point to the line of code which from your point of view doesn't exist in whole universe for sure.

 

image

However, there is a little entropy of information in the error described above.

The error is caused by declaration of the namespace (not shown above): xmlns:controls="clr-namespace:Daenet.Xy.Controls"

Because designed for same reason doesn't parse this correctly you can help a bit.
Change namespace as following and all will work fine:
xmlns:controls="clr-namespace:Daenet.Xy.Controls;assembly=MyAssembly"

Where MyAssembly is the name of assembly which implements controls with namespace Daenet.Xy.

If you want to do all right way, use always assembly attribute in the namespace declaration.

This is all.


Posted Mar 02 2009, 03:59 PM by Damir Dobric

Comments

Xhizors wrote re: Designer Issue in Silverlight
on 03-20-2009 21:24

Good post, admin.

developers.de is a .Net Community Blog powered by daenet GmbH.