Error 102: The type reference cannot find a public type named '*'.

This error occurs in XAML when you have something like:

1
2
3
4
5
6
7
<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Core="clr-namespace:Company.Core;assembly=Company.Core">
...
<style x:Key="xxx" TargetType="{x:Type Core:SomeObject}">
...
</style></resourcedictionary>

and the compiler cannot find the ‘SomeObject’ class. Now, you can safe yourself a few hours because this error is totally fake. There is no problem with the namespace or the XAML syntax. Just change the definition of the ‘core’ (whatever name in your context) alias to

1
2
3
4
5
6
7
<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Core="clr-namespace:Company.Core">
...
<style x:Key="xxx" TargetType="{x:Type Core:SomeObject}">
...
</style></resourcedictionary>

and all will be well. For some reason when you refer to a class withing the same assembly you should not set the ‘assembly’.

4 Responses to Error 102: The type reference cannot find a public type named '*'.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

top