question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft.UI.Xaml.Media.PointCollection throws TypeLoadException

See original GitHub issue

Describe the bug You cannot create a Polygon from code. XAML works. App throws: TypeLoadException: Could not load type ‘ABI.Windows.Foundation.Point’ from assembly ‘Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b’.

Steps to reproduce the bug

var polygon = new Microsoft.UI.Xaml.Shapes.Polygon();
 polygon.Points.Add(new Point(10, 110));

var collection = new Microsoft.UI.Xaml.Media.PointCollection();

Steps to reproduce the behavior:

  1. Create new Blank App, Packaged with WAP (WinUI 3 in Desktop).
  2. Open MainWindow.xaml.cs.
  3. Create polygon with points.
  4. Run code

Expected behavior The code should work like xaml <Polygon Points="10,110 60,10 110,110" Fill="Blue" />

Screenshots image

Version Info

NuGet package version: Microsoft.WindowsAppSDK.WinUI 1.0.0-experimental1

Windows app type:

UWP Win32
Yes
Windows version Saw the problem?
Insider Build (xxxxx)
May 2021 Update (19043) Yes
October 2020 Update (19042)
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop <Yes
Xbox
Surface Hub
IoT

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
artkatcommented, Oct 23, 2021

This issue seems fixed in WinUI 0.8.5

1reaction
Marv51commented, Sep 20, 2021

As I said: CsWinRT has fixed this, but no update has been released yet. Feel free to upvote that discussion I linked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PointCollection Class (Windows.UI.Xaml.Media)
Represents a collection of Point values that can be individually accessed by index.
Read more >
TypeLoadException Class (System)
TypeLoadException is thrown when the common language runtime cannot find the assembly, the type within the assembly, or cannot load the type.
Read more >
PointCollection Class (Microsoft.UI.Xaml.Media)
Represents a collection of Point values that can be individually accessed by index.
Read more >
SystemBackdrop Class (Microsoft.UI.Xaml.Media)
Base class for custom system backdrops used to render materials like Mica and Acrylic.
Read more >
PointCollection.IndexOf(Point, UInt32) Method
Retrieves the index of the specified item.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found