views:

1901

answers:

2

I have a XAML file that references custom controls defined into another assembly. It compiles and works perfectly at runtime, but the XAML designer is choking and does not show the design content.

<Window x:Class="MyProgram.AboutWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:copy="clr-namespace:MyCompany.Common.CopyProtection;assembly=Common"
    Title="About Box" Height="400" Width="400" SizeToContent="Height">
    <copy:RegistrationPanel  />
</Window>

The class MyCompany.Common.CopyProtection is loacted inside the Common assembly, which is in the references for this project. The class is public, and freshly built.

I am using Visual Studio Express 2008 with .NET 3.5 SP1. Here are the errors:

Problem Loading

The document contains errors that must be fixed before the designer can be loaded. Reload the designer after you have fixed the errors.

Error 1 The type 'copy:RegistrationPanel' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
Error 2 Assembly 'Common' was not found. Verify that you are not missing an assembly reference. Also, verify that your project and all referenced assemblies have been built.

Anybody knows how to solve those errors so I can start using the designer again. The designer is pratical to select XAML elements and quicly jump into XAML code.

+1  A: 

I had a problem with this where I had styles as StaticResource, after changing these into DynamicResource it worked well for me.

Fredrik Jansson
I have no style in my XAML
decasteljau
+2  A: 

The WPF designer included with VS2008 is inadequate for all but the simplest of tasks. My advice is don't use it and instead use something Blend if you can, or perhaps Kaxaml for smaller XAML tests.

I turn the XAML editor off completely by mapping the .xaml extension to the standard XML Editor. This improves load times, and avoids all these annoying "errors" spewed out by the XAML designer.

HTH, Kent

Kent Boogaart