Just yesterday I was struggling with the same issue, only this facette of it seems like a completely different bug. You see, I added this control to the library and everything worked fine EXCEPT the visual designer. It is known that the Visual Studio 2008 WPF designer is not the best possible piece of software, but this was one of those errors you don't know where it comes from.

So, let's take it from the beginning. I had something like
<HierarchicalDataTemplate DataType="{x:Type Code:League}" ItemsSource="{Binding Path=Divisions}">
<TextBlock Text="{Binding Path=Name}"/>
</HierarchicalDataTemplate>
Somewhere in the Window declaration there was a
xmlns:Code="clr-namespace:MyControls.Desktop.Code"
which is the namespace of the test application for the control in the library.
The application worked, but in the designer an error like "Type reference cannot find public type named 'League'.".

Many people gave the solution to remove the name of the assembly in the namespace declaration. So If I had something like "clr-namespace:MyControls.Desktop.Code;assembly=MyControls" and it was the current assembly, I should just remove it. Well, it wasn't the case here, was it?

In the end I found the solution here. You see, even if the assembly name was not specified, it was implied! And even if it was an application, not a library, it still was an assembly. And the Application name was... something with spaces in it!!

So, again, just go to the Project properties and change the Assembly name to not have spaces!

Comments

Anonymous

Eh, just saw you&#39;re from Bucharest :) Adicatelea abia acum vazushi ca suntem concitadini :D Succesuri!

Anonymous

Anonymous

Chrome. After a minute of reading, it showed 10 times in history. Anyway, thanks for this posting:)

Anonymous

Siderite

It shouldn&#39;t. It should only change the hash. What browser are you using?

Siderite

Anonymous

WHY is your page refreshing constantly????

Anonymous

Anonymous

Many thanks! Your explanation helped where so many others had failed :D

Anonymous

Post a comment