Tek Mun
Tek Mun

Reputation: 99

Xamarin.UWP error after upgrading to Xamarin.Forms 3.6

I upgraded to Xamarin.Forms 3.6 and the following error occurs.

System.MissingMethodException: 'Method 'CanvasImageSource.get_SizeInPixels()' from assembly 'Microsoft.Graphics.Canvas' was not included in compilation, but was referenced in ImageRenderer.GetDesiredSize(double, double). There may have been a missing assembly, or a dependency on a more recent Windows SDK release.'

The error occurs on this line:

Absoluate.Layout.SetLayoutBounds(navigationlayout, new Rectangle(0, 0, 1, 46);

In Xaml, navigation layout is

<StackLayout x:Name="navigationlayout" Orientation="Horizontal" AbsoluteLayout.LayoutFlags="WidthProportional">
...
</StackLayout>

I also installed the latest pre-release Xamarin.Forms 4.0.0-pre5 gives the same error.

Reverting back to Xamarin.Forms 3.5.0.169047, the app runs normally.

Upvotes: 2

Views: 264

Answers (1)

Tek Mun
Tek Mun

Reputation: 99

I found the answer in Github.

(1) In UWP project, install Win2D Nuget package. (2) In UWP project, set the minimum target to Windows 10, version 1803 (10.0; Build 17134)

Update to Xamarin.Forms 3.6. Viola, the UWP app runs smoothly.

Upvotes: 2

Related Questions