引用类型'Assembly'声称它在'System.Runtime'中定义,但是在Xamarin UWP中找不到 [英] Reference to type 'Assembly' claims it is defined in 'System.Runtime', but it could not be found in Xamarin UWP

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

问题描述

已经发现了相同的问题

Already found the same problem here.

我的错误:

严重性代码描述项目文件行抑制状态 错误CS7069对装配体"类型的引用声称它是在"System.Runtime"中定义的,但找不到它

Severity Code Description Project File Line Suppression State Error CS7069 Reference to type 'Assembly' claims it is defined in 'System.Runtime', but it could not be found

该线程上的解决方案是在所有项目中将xamarin表单降级为2.5.1.527436版本.但是我无法在项目中执行此操作,因为我正在使用一些最新的xamarin形式中可用的功能,例如android底部标签功能,编辑器的autosize属性和listview的flowdirection属性.

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.

将xamarin表格从2.5.0.121934更新到3.4.0.1008975后,我遇到了这个问题.问题仅在UWP部件上. Android和IOS应用程序运行正常.

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.

错误行:

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);

那么如何在不降级Xamarin.Forms的情况下解决此问题?

更新

再次针对另一个项目遇到相同的问题.但是,这里的解决方案不是修复错误.将Windows项目的目标版本更改为windows 10, version 1809(10.0;Build 17763),将最小版本更改为Windows 10 Fall Creators Update(10.0; Build 16299).屏幕截图添加到下面:请提出解决方案.

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版本:3.4.0.1008975

推荐答案

正如链接的线程所述,问题在于您的应用必须将最低UWP版本设置为Fall Creators Update(16299),因为这是第一个发行版支持 .NET Standard 2.0 .

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.

版本3.0 中,Xamarin.Forms放弃了对可移植类库的支持,现在仅针对 .NET Standard 2.0 .这意味着您必须至少以UWP中的Fall Creators Update(16299)为目标,以确保可以对其进行引用.

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.

要将UWP项目重新定位到较新的版本,请在 Solution Explorer 中的UWP项目节点上单击鼠标右键,选择 Properties ,然后使用两个下拉菜单至少选择一个两者都为16299版本.

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.

只要您不需要支持Windows 10移动版,就可以更改Min版本,因为绝对的大多数用户已经在1803版上,并且Fall Creators Update是1709版.请参见以下用法图(按 AdDuplex )

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中找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆