0

In a Xamarin iOS project I am getting error CS0121 for every async use of BlobCache after upgrading from akavache 4.1.2 to the newest 6.3.2:

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

This happens for every use of BlobCache, e.g:

var result = await BlobCache.UserAccount.GetObject<List<MovieModel>>("history").FirstAsync();

If I remove FirstAsync it is GetAwaiter which becomes ambiguous.

I declare: using System.Reactive.Linq;

I think maybe it could be a version problem, but I can't find any information on this problem that has helped. I have upgraded ALL nuget packages. I have uninstalled all akavache packages and the system.reactive package and re-installed with no effect. I have cleared the nuget cache. I have restarted visual studio 2017 (fully up-to-date). Cleaned and deleted bin folder.

I don't understand what the ambiguity is. How can I troubleshoot or solve this?

Tarostar
  • 1,196
  • 1
  • 15
  • 27
  • Do you have any references to the old rx- nuget packages? Also are you using PackageReference over packages.config? – Glenn Watson Feb 05 '19 at 10:12
  • Not that I can see. Anything in particular I should check. – Tarostar Feb 05 '19 at 10:56
  • 1
    Check the content of your project's .csproj file. Make sure your project's does not have a double reference to a System.Reactive.Linq.dll file – Miiite Feb 05 '19 at 11:05
  • 1
    Well with system.reactive 4.0 and above only include system.reactive. nothing else is needed – Glenn Watson Feb 05 '19 at 12:04
  • Ok, thanks to Miiite and Glenn Watson I think I have solved it - so might want to make an actual answer so I can approve it. I noticed in .csproj references to various System.Reactive dll files in addition to System.Reactive. So following Watson's suggestion I deleted all additional references to system.reactive under references in the solution explorer and now it compiles and runs. – Tarostar Feb 05 '19 at 13:17
  • PS! Strangely I am still getting: warning MSB3277: Found conflicts between different versions of "System.Reactive" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. This does not prevent it from running though. – Tarostar Feb 05 '19 at 13:18
  • Maybe try a bin/obj folder deletion? Sometimes after this stuff happens nuget gets a bit confused. – Glenn Watson Feb 06 '19 at 00:38

0 Answers0