views:

1790

answers:

2

Update:

Screenshot http://farm4.static.flickr.com/3277/3048788466_661e8e5e78_b.jpg

To reproduce:

  1. Get this sample project from Silveright.net - http://download.microsoft.com/download/5/9/2/5922d533-7ed5-4065-a138-ce3d9ca266e5/4-UserControls_Source_CS.zip

  2. Open the UserControlDemo Solution. Then on Line 9 of Page.xaml, you'll see the error.

    http://download.microsoft.com/download/5/9/2/5922d533-7ed5-4065-a138-ce3d9ca266e5/4-UserControls_Source_CS.zip

I'm creating a User Control in Silverlight 2 using this as my guide.

The problem is that when I use my User Control in Page.xaml, the XAML canvas shows this error: "Unknown attribute Name on element ... ."

Due to this error, I can no longer preview my XAML canvas. The strange thing is that the project still builds and renders my User Control beautifully.

Upon investigating the problem, I've found out the the cause of the problem was that my User Control was using a Style which is a StaticResource. When I remove this Style Property, the error in my Page.xaml XAML file disappears.

This error has been talk about in other online threads but unfortunately to no resolve.

I'm using the latest release and service packs of Visual Studio 2008 and Silverlight 2.

Is there something wrong with what I'm doing or is this a VS/Silverlight bug?

Thanks in advance!

+1  A: 

You might try this article for a workaround:

Resource Sharing in Silverlight

Tim Erickson
By reading the article, I'm guessing that this is the problem.So I guess its a Silverlight bug. Thanks Tim!
ptio
A: 

In my experience the Visual Studio XAML designer, especially with Silverlight, will crap out for pretty much anything. I can't open a XAML file without all sorts of those mysterious errors and when it does render in the designer, it's not usually very useful.

MojoFilter