Ambiguous call when using certain libraries at once

Viewed 375

In my Xamarin project I'm using ReactiveUI and Firebase.Xamarin. When these two libraries are being used at once, any attempt to use System.Reactive.Linq.Observable extension methods such as Where or Select results in compile time error:

The call is ambiguous between the following methods or properties: 'System.Reactive.Linq.Observable.Where(System.IObservable, System.Func)' and 'System.Reactive.Linq.Observable.Where(System.IObservable, System.Func)'

I presume this is being caused by both of these libraries defining/referencing the same methods in same namespaces. How can I fix that?

2 Answers

It is likely that you are loading more than one version of the assembly that defines that namespace. It may be that the assemblies that you refer to load a common dependency. If they load different versions of that assembly you would get this error.

Ensure that you are using versions of the two libraries that depend on the same version of the dependant assembly.

Firebase.Xamarin is no longer maintained so if I wanted to follow @PhilipSmith advice I would have to use ReactiveUI version that is over 2 years old. I didn't wanted to do it so I decided to clone Firebase.Xamarin since its OSS and add it to my solution as another project with intention to alter the ReactiveUI version it was referencing. But when I added is as a referenced project the error disappeared.

Related