Environment
- Visual Studio 2008 SP1
- Visual C#
- WPF Application Project
- .NET Framework 3.5
Problem
You have a user control in the same assembly as another user control or window, and you are using it in this new user control or window. It compiles and runs fine, however the designer doesn't work and gives an exception "Could not create an instance of type 'x'.". This prevents the designer from rendering and the project from compiling while the designer is visible.
Workaround
While by hiding the designer on these controls and windows it allows the code to compile this is not an expectable solution as it prevents me from viewing and using the designer completely for these controls and windows.
Code Examples
xmlns:local="clr-namespace:Foo.Bar.MyWpfApplication"
...
<Grid>
<local:MyUserControl Grid.Row="1" x:Name="myControl" />
</Grid>
Also tried this namespace statement with not change to the issue:
xmlns:local="clr-namespace:Foo.Bar.MyWpfApplication;assembly="
Question
Has anyone had this issue and solved it?
For reference I have tried the solutions posted in this thread and they didn't work.
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/56f933c8-a093-4c47-8e1a-cde4bb1864e9