Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Observable class and ToObservable missing from System.Reactive 3.0

After installing the 3.0 version of System.Reactive.Core from Nuget (https://www.nuget.org/packages/System.Reactive.Core), I can't get the Observable class to compile or appear. The ToObservable extention method is also missing from my generic List<>.

I have the following packages installed and referenced in my project (.NET v4.6.1 C# console project):

System.Reactive.Core (3.0.0.0) System.Reactive.Interfaces (3.0.0.0) System.Reactive.Windows.Threading (3.0.0.0)

I am using the following:

using System.Text;
using System.Threading.Tasks;
using System.Reactive;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Reactive.Concurrency;
using System.Reactive.PlatformServices;
using System.Reactive.Disposables;`

And still I'm getting errormessages "The name 'Observable' does not exist in the current context" and "List does not contain a definition for 'ToObservable'...".

I want to get a "HelloWorld" example up and running and I was hoping to use Observable.Range?

like image 501
bob the builder Avatar asked Jul 08 '16 10:07

bob the builder


1 Answers

You want to Install-Package System.Reactive

Reactive Extensions Main Library combining the interfaces, core, LINQ, and platform services libraries.

With the package, you will get the static Observable class and also the extensions for IEnumerable.

If you don't want to install platform services, you can also run these to get the features you need.

Install-Package System.Reactive.Core
Install-Package System.Reactive.Linq
like image 179
supertopi Avatar answered Nov 15 '22 13:11

supertopi