This project has moved and is read-only. For the latest updates, please go here.

GetResponseObservable - ambigous invocation

Topics: General
Oct 15, 2012 at 5:51 PM

Hi all, I just upgraded (using Nuget) to Rx v2 and Rxx v1.3, and my code stopped compiling. Yes, a really little annoying error, that I can't seem to get around. The compiler says that the call to WebRequest.GetResponseObservable() extension method in the WebRequestExtensions class is ambigous, and lists two identical signatures. I looked at the assembly in dotPeek, and only found one method. I scratched my head for a while, then made sure I had previous versions of both Rx and Rxx uninstalled, then restarted VS2010, then restarted my machine, and did a clean, followed by a rebuild, but the error is still there. Has anyone else seen this?

To be certain, I created a demo project (a hello world wpf app), with just two lines added:

WebRequest wr = WebRequest.Create("");
var observable = wr.GetResponseObservable();

But the compiler complains immediately. I'm using version 2.0.20823.0, and Rxx version 1.3.4451.33754.

Any help or push in the right direction would be much appreciated. Am I missing something obvious?

Oct 15, 2012 at 6:31 PM

Well, I finally figured it out. When you add Rxx using "Manage Nuget Packages...", it not only adds the Rxx assembly, but also the Rxx.Contracts assembly. The GetResponseObservable() method (and others) are defined in both assemblies. The solution is to remove the Rxx.Contracts assembly reference, and all is fine. Just thought I'd post the solution here, in case other people bump into it.

Oct 16, 2012 at 8:32 AM


I think you discovered the problem in your other post.

- Dave