本文介绍了对类型“Assembly"的引用声称它在“System.Runtime"中定义,但在 Xamarin UWP 中找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经发现同样的问题

解决方案

正如链接线程提到的,问题是你的应用程序必须将最低 UWP 版本设置为 Fall Creators Update (16299),因为这是第一个版本支持.NET Standard 2.0.

3.0 版中,Xamarin.Forms 不再支持可移植类库,现在仅面向 .NET Standard 2.0.这意味着你必须至少在 UWP 中定位 Fall Creators Update (16299) 以确保它可以被引用.

要将 UWP 项目重定向到较新版本,请在解决方案资源管理器中右键单击 UWP 项目节点,选择属性,然后使用两个下拉列表选择至少两个版本均为 16299.

只要您不需要支持 Windows 10 移动版,更改最低版本应该没问题,因为绝对大多数用户已经使用了 1803 版,而 Fall Creators Update 是 1709 版.请参阅以下使用图(由

Already found the same problem here.

My error:

The solution on that thread is downgrade the xamarin forms to version 2.5.1.527436 in all the projects. But I can't do that in my project, because I am using some features that are available in latest xamarin forms like android bottom tab feature, autosize property of editor and flowdirection property of listview.

I have this problem after updating xamarin forms to 3.4.0.1008975 from 2.5.0.121934. Problem is only on the UWP part. Android and IOS apps are working fine.

Error lines:

var rendererAssemblies = new List<Assembly>
   {
       typeof(ImageCircleRenderer).GetTypeInfo().Assembly
   };
rendererAssemblies.AddRange(Rg.Plugins.Popup.Popup.GetExtraAssemblies());
Rg.Plugins.Popup.Popup.Init();
Xamarin.Forms.Forms.Init(e, rendererAssemblies);

So how can I fix this issue without downgrading Xamarin.Forms?

Update

Facing the same problem again for another project. But the solution here is not fixing the error. Changed the target version of windows project to windows 10, version 1809(10.0;Build 17763) and min version to Windows 10 Fall Creators Update(10.0; Build 16299). Screenshot adding below: please suggest a solution.

Xamarin.Forms Version: 3.4.0.1008975

解决方案

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)

这篇关于对类型“Assembly"的引用声称它在“System.Runtime"中定义,但在 Xamarin UWP 中找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 08:36