Question

I'm using Visual Studio 2013 with .NET framework version 4.5.1

I am reading tutorials on Reactive Extensions, and am trying to run this code:

var t = Task.Factory.StartNew(() => "Test");
var source = t.ToObservable();

t.ToObservable() is underlined and gives me the error

System.Threading.Tasks.Task<.string> does not contain definition for ToObservable...

I read in another post that I should download Silverlight Toolkit and include the System.Reactive.dll it comes with as a reference, but that did not help.

What should I do to fix this?

Was it helpful?

Solution

That extension method is defined in the System.Reactive.Threading.Tasks namespace.

You need to import the namespace first.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top