【发布时间】:2017-08-28 18:03:45
【问题描述】:
我最近将我的解决方案更新为 Xamarin.Forms (2.3.4.267) 的最新 nuget 包。现在我在 Android Emulator (X86) 中运行程序时收到异常
Unhandled Exception:
System.PlatformNotSupportedException: Operation is not supported on this platform.
有了这段代码:
public virtual void AddRange(IEnumerable<T> collection)
{
if (collection == null) throw new ArgumentNullException(nameof(collection));
foreach (var i in collection) Items.Add(i);
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
}
尤其是一行
foreach (var i in collection) Items.Add(i);
这是一个测试问题的github链接 https://github.com/hugoterelle/posexclusive-droid-notsupported
【问题讨论】:
-
我无法重现您的问题,能否请您发布更完整的代码来重现此问题?
-
@YorkShen-MSFT 抱歉耽搁了,我需要时间来清理解决方案以提供 github 存储库。您可以在编辑后的问题中找到它。
标签: c# android xamarin xamarin.forms