Bug 39566 - System.InvalidOperationException: Sequence contains more than one matching element
Summary: System.InvalidOperationException: Sequence contains more than one matching el...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-12 22:12 UTC by faceoffers28
Modified: 2016-05-07 23:44 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description faceoffers28 2016-03-12 22:12:47 UTC
I am running Xamarin.Forms 2.0.0.6490 in my PCL Project. In my IOs Project, I am running Xamarin.Forms 1.5.1.6471. This works just fine. I now need to upgrade the IOs Project to 2.0.0.6490 in order to fix a problem with the Xamarin.Forms.ImageSource not resolving. When I do, I get this error upon deploying the app to my IOs device for testing. For now, I am just going to re-install 1.5.1.6471. 

***BEGIN exception*** 

System.InvalidOperationException: Sequence contains more than one matching element
  at System.Linq.Enumerable.Single[FieldInfo] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable.SingleOrDefault[FieldInfo] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.ReflectionExtensions.GetField (System.Type type, System.Func`2 predicate) [0x00006] in <filename unknown>:0
  at Xamarin.Forms.BindablePropertyConverter.ConvertFrom (System.Type type, System.String propertyName, IXmlLineInfo lineinfo) [0x00017] in <filename unknown>:0
  at Xamarin.Forms.BindablePropertyConverter.Xamarin.Forms.IExtendedTypeConverter.ConvertFrom (System.Globalization.CultureInfo culture, System.Object value, IServiceProvider serviceProvider) [0x0013e] in <filename unknown>:0
  at Xamarin.Forms.Xaml.TypeConversionExtensions.ConvertTo (System.Object value, System.Type toType, System.Func`1 getConverter, IServiceProvider serviceProvider) [0x0003d] in <filename unknown>:0
  at Xamarin.Forms.Xaml.TypeConversionExtensions.ConvertTo (System.Object value, System.Type toType, System.Func`1 minfoRetriever, IServiceProvider serviceProvider) [0x00021] in <filename unknown>:0
  at Xamarin.Forms.Xaml.ApplyPropertiesVisitor.SetPropertyValue (System.Object xamlelement, XmlName propertyName, System.Object value, Xamarin.Forms.BindableObject rootElement, INode node, Xamarin.Forms.Xaml.HydratationContext context, IXmlLineInfo lineInfo) [0x00357] in <filename unknown>:0
  at Xamarin.Forms.Xaml.ApplyPropertiesVisitor.Visit (Xamarin.Forms.Xaml.ValueNode node, INode parentNode) [0x0005e] in <filename unknown>:0
  at Xamarin.Forms.Xaml.ValueNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00054] in <filename unknown>:0
  at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00089] in <filename unknown>:0
  at Xamarin.Forms.Xaml.FillResourceDictionariesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, INode parentNode) [0x00185] in <filename unknown>:0
  at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00008] in <filename unknown>:0
  at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00089] in <filename unknown>:0
  at Xamarin.Forms.Xaml.RootNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x0002f] in <filename unknown>:0
  at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject view, System.String xaml) [0x000be] in <filename unknown>:0
  at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject view, System.Type callingType) [0x0002e] in <filename unknown>:0
  at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[SignIn] (FaceOffers.Views.SignIn view, System.Type callingType) [0x00000] in <filename unknown>:0
  at FaceOffers.Views.SignIn.InitializeComponent () [0x0000c] in /Users/bteague28/Development/FaceOffers-9/Xamarin_FaceOffers/FaceOffers/FaceOffers/obj/Debug/FaceOffers.Views.SignIn.xaml.g.cs:30
  at FaceOffers.Views.SignIn..ctor () [0x00008] in /Users/bteague28/Development/FaceOffers-9/Xamarin_FaceOffers/FaceOffers/FaceOffers/Views/SignIn.xaml.cs:19
  at FaceOffers.App..ctor () [0x0000c] in /Users/bteague28/Development/FaceOffers-9/Xamarin_FaceOffers/FaceOffers/FaceOffers/App.cs:24
  at FaceOffers.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00007] in /Users/bteague28/Development/FaceOffers-9/Xamarin_FaceOffers/FaceOffers/FaceOffers.iOS/AppDelegate.cs:28
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/src/UIKit/UIApplication.cs:74
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0001c] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/src/UIKit/UIApplication.cs:57
  at FaceOffers.iOS.Application.Main (System.String[] args) [0x0008f] in /Users/bteague28/Development/FaceOffers-9/Xamarin_FaceOffers/FaceOffers/FaceOffers.iOS/Main.cs:36

***END exception***

Please let me know if you need anything else.

Thanks!
Comment 1 Paul DiPietro [MSFT] 2016-03-19 01:33:41 UTC
Have you tried running the latest stable 2.1 release? You should not be running different versions of Forms across your projects. Beyond that, a specific reproduction would be needed to help investigate the issue. Please feel free to reopen this with a reproduction if using the latest stable across all projects (with a clean and rebuild) does not resolve your issue.
Comment 2 faceoffers28 2016-05-07 21:31:53 UTC
I'm now running into this same issue while trying to upgrade my Xamarin.Forms Android app. Again, I'm trying to upgrade to Xamarin.Forms 2.0.0.6490 to get in sync with the Portable. I guess I will try to upgrade the Portable plus IOs and Android to 2.1.
Comment 3 faceoffers28 2016-05-07 21:47:57 UTC
OK, I just upgraded to XF 2.1.0.6529 and the problem still exists.
Comment 4 faceoffers28 2016-05-07 23:44:47 UTC
OK, it looks like you guys fixed this in this release. https://www.nuget.org/packages/Xamarin.Forms/2.2.0.4-pre1

I can now confirm that both my Android and IOs apps are working with XF 2.2.0.31. Thanks ever so much! I did not realize that this was being worked on let alone fixed.