0

I created a WPF UserControl library. I imported it into an WPF application. While the platform is "Any CPU" everything works as expected:

But when I switch to x86 or x64 the default values of the dependency properties become null:

Is this a bug in Visual Studio 2017 or am I missing something here?

91378246
  • 367
  • 2
  • 5
  • 21
  • I think the UserControl library should be configured the same way as your main WPF, i.e if your UserControl library is set any Cpu so, is your main WPF app, so try to change the build in the UserControl to x64 – styx Feb 10 '19 at 10:10
  • I tried this already, same result... – 91378246 Feb 10 '19 at 10:14

1 Answers1

0

When putting the control, Visual Studio loads the assembly.
However, Visual Studio is an x86 application.
As a result, it is not possible to read x64 assemblies, and it might be an error.
For a similar problem, many articles seem to conclude that "build an assembly with AnyCPU".

ref:
Visual studio designer in x64 doesn't work
Cannot Place User Control on Form

wata
  • 76
  • 4
  • Thank you for you answer but I don't think that this is the problem, as it also occurs with a x86 build configuration (and I can't use any CPU for my project). – 91378246 Feb 10 '19 at 10:51