Reference to type 'Assembly' claims it is defined in 'System.Runtime', but it could not be found in Xamarin UWP

前端 未结 1 1382
故里飘歌
故里飘歌 2021-01-25 06:08

Already found the same problem here.

My error:

Severity Code Description Project File Line Suppression State Error

1条回答
  •  有刺的猬
    2021-01-25 06:38

    As the linked thread mentions, the problem is that your app has to have min UWP version set to Fall Creators Update (16299), because this is the first release that supports .NET Standard 2.0.

    In version 3.0 Xamarin.Forms dropped support for Portable Class Libraries and is now targeting .NET Standard 2.0 only. This means you must target at least Fall Creators Update (16299) in UWP to make sure it can be referenced.

    To retarget your UWP project to the newer version, right-click the UWP project node in Solution Explorer, select Properties and then use the two dropdowns to select at least version 16299 in both.

    Changing the Min version should be okay as long as you don't need to support Windows 10 Mobile, because absolute majority of users is already on version 1803 and Fall Creators Update is version 1709. See following usage graph (by AdDuplex)

    0 讨论(0)
提交回复
热议问题