Cannot reference a control inside a ControlTemplate

I have a ResourceDictionary that contains a ControlTemplate where I reference an object from another assembly.

<ResourceDictionary
    xmlns:gauge="clr-namespace:ActiproSoftware.Products.Gauge;assembly=ActiproSoftware.Gauge.Wpf351">

    <ControlTemplate x:Key="Gauge270Template">
        <gauge:CircularGauge/>
    </ControlTemplate>
</ResourceDictionary>

Which gives me the following error:

Error   1   The type 'gauge:CircularGauge' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

PS The sensor assembly is built, and I can refer to it from other parts of the application.

+3
source share
1 answer

Make sure that both assemblies do not target the client profile in the Assembly section of the project properties. Most likely, the assembly with the link to the Gauge control is configured on the target client profile .Net Framework 4.0 (by default from VS 2010) (this problem can also be seen in the section on warnings about your assembly errors)

+1

Source: https://habr.com/ru/post/1780405/


All Articles