Silverlight

I came across a problem when using Visual Web Developer 2008 to develop for Silverlight. When adding an xmlns for your application to your UserControl, the compiler complains about a missing assembly reference.

<UserControl
        x:Class="SilverlightApplication1.Page"
        xmlns:My="clr-namespace:SilverlightApplication1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Width="400" Height="300">
    <Grid x:Name="LayoutRoot" Background="Black">
        <Canvas x:Name="surface">
            <My:Foo x:Name="bar" Canvas.Left="305" Canvas.Top="220"/>
        </Canvas>
    </Grid>
</UserControl>

You can fix this by removing the My:Foo element and building the project before adding the element back in.