I first learned about Reactive Extensions (Rx) begin this month when it was open sourced by Microsoft. Although I found a few scattered references on the internet on how to get Rx working with Mono, I had to jump through quite a few hoops. This blogpost is a detailled account and will hopefully save you a couple of hours.
Getting Reactive Extensions
When you are using Windows this is pretty straightforward. But then again, in that case you are probably using .NET and not reading this blogpost at all. However when you are using Linux or OS-X it gets a bit more complicated. In that case your only option is to use NuGet.
I didn’t download the recommended version (NuGet.exe Bootstrapper 2.0) but used the NuGet.exe Command Line. This didn’t work out of thebox. According to this excellent blog post you first have to import some root certificates so that Mono will trust NuGet:
$ mozroots --import --sync
Next you type:
$ mono NuGet.exe
This will result in output similar to:
NuGet bootstrapper 188.8.131.52
Found NuGet.exe version 2.1.2.
You now have NuGet running. To get help type:
$ mono NuGet.exe help
Ok, so let’s finally get Rx. I started with the latest and greatest (Rx-Main 2.0.21114 at the moment of writing) but I didn’t get that working. However version Rx-Main 1.0.11226 does seem to work with Mono. To see all available versions enter:
$ mono NuGet.exe list Rx-Main -AllVersions
To install the latest Rx 1.0 enter:
$ mono NuGet.exe install Rx-Main -Version 1.0.11226
This will download Rx-Main into your current working directory. You can find the dll you need as: ./Rx-Main.1.0.11226/lib/Net4/System.Reactive.dll
Read more: Maurits thinks aloud