During an upgrade of a C# WPF application that was using Reactive Extensions, I ran into this compile error:
The type ‘System.IObservable
exists in both ‘c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll’ and ‘c:\Program Files (x86)\Microsoft Reactive Extensions\Redist\DesktopV2\System.Observable.dll’
This is roughly the same kind of Defined in Multiple Assemblies problem as I faced before. (Solution provided.)
In this case, the System.Observable.dll was pinned to the 3.5 release of the Reactive Extensions.
The solution was to:
- Download the .NET 4.0 version of Reactive Extensions (Rx_Net4.msi).
- Install it.
- Remove System.Observable from the project.
- Re-add the System.Observable to the project, being super careful to select the latest version