CustomControl TargetType does not match type of element throws error in WPF designer

Sudharsan Narayanan 1 Reputation point
2021-08-25T17:12:27.743+00:00

126370-designer-issue.pngHi,

I have created a custom control in WPF. While working with that custom control in WPF designer, it is throwing "TargetType does not match the type of element" in the designer. But I'm getting a visual studio designer exception using the WPF Controls library. Styles are in another project and the ResourceDictionary is Merged in app.xaml.

I have also noticed that the issue only happens when selecting x64 as the active solution platform as opposed to the default Any CPU, but this also means that I have to switch change from x64 when running in Debug mode.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,686 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,382 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
772 questions
{count} votes