Description
When updating to the new Rx, and possibly the version just behind it, the version number of the various System.Reactive.* (Core, etc) seems to be different depending on what project target the Nuget is installed into.
The result of this is that all Observable related code breaks at runtime at least in our unit tests, and I assume in the Android, etc client as well.
When installed into a PCL, System.Reactive.Core comes from:
packages\System.Reactive.Core.3.1.1\lib\netstandard1.0\System.Reactive.Core.dll
When installed into a unit test project, System.Reactive.Core comes from:
packages\System.Reactive.Core.3.1.1\lib\net45\System.Reactive.Core.dll
Using the Visual Studio Properties window on Project > References > System.Reactive.*, the PCL has the following values:
Runtime Version: v4.0.30319, Version: 3.0.0.0
However, the unit test project has:
Runtime Version: v4.0.30319, Version: 3.0.1000.0
Running the single test in the following project produces the following output:
Test method RxTest.Unit.UnitTest1.TestMethod1 threw exception:
System.IO.FileLoadException: Could not load file or assembly 'System.Reactive.Linq, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at RxTest.Lib.Class1.get_TestObservable()
at RxTest.Unit.UnitTest1.TestMethod1() in C:\Users\joshu\Documents\Visual Studio 2015\Projects\RxTest\RxTest.Unit\UnitTest1.cs:line 14
I assume this is due to the Nuget DLL versions being out of sync, but am not familiar enough with this codebase to confirm.
Here is a little project, run the single unit test to see the issue:
https://github.com/LifeCoder45/rx-issue
It has a class in the PCL:
https://github.com/LifeCoder45/rx-issue/blob/master/RxTest.Lib/Class1.cs
public class Class1
{
public IObservable<string> TestObservable => new Subject<string>();
}
That this single unit test accesses:
https://github.com/LifeCoder45/rx-issue/blob/master/RxTest.Unit/UnitTest1.cs
[TestMethod]
public void TestMethod1()
{
var x = new Class1().TestObservable;
}