WindowsCompositionSamples: Method not found: 'Void Windows.UI.Composition.Visual.put_Size(System.Numerics.Vector2)'

I am currently on Build 14376, SDK 14366 and Visual Studio Update 3. I am creating a custom UWP control. In the ArrangeOverride() method of the control I am creating a few visuals and adding them to the visual tree.

Now when I add this control to the XAML, in the XAML Designer, it shows the following error

Method not found: 'Void Windows.UI.Composition.Visual.put_Size(System.Numerics.Vector2)'

Debugging the XAML Designer gives the following information

An exception of type 'System.MissingMethodException' occurred in Microsoft.VisualStudio.DesignTools.UniversalXamlDesigner.DLL and wasn't handled before a managed/native boundary

Additional information: Method not found: 'Void Windows.UI.Composition.Visual.put_Size(System.Numerics.Vector2)'.

It would be great if you could tell me how to resolve this issue.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 29 (5 by maintainers)

Most upvoted comments

For the time being I am able to work around the issue by putting this check inside my custom shadow control. Basically, don’t let the Designer get to the Composition code!

        public ShadowWrapper()
        {
            DefaultStyleKey = typeof(ShadowWrapper);

            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled) return;

            _compositor = this.Visual().Compositor;

I am also getting this annoying issue. @msftdavid wonder if you have been able to reproduce it yet?

Hi all, sorry for the delay. After communicating with the UWP Toolkit folks this should be fixed in these PRs:

You’ll notice one of the issues mentioned in those PRs (https://github.com/Microsoft/UWPCommunityToolkit/issues/1224) has the same Vector2 error message that’s been discussed on this thread. Seeing as how the fix has been verified I’m going to close this issue out. If upon updating this is still a problem, please open a new github issue using the template to share detailed repro steps and machine configuration details. Thank you for your patience through this long thread.