0

How do I resolve this build error please? (Am getting it on updating my C# project to use .Net 4.0)

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’

Also, I did also use nuget to install Rx 2.2.5 version.But I dont see Sysem.Observable.dll in its packages directory.Please advise.

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Mitu
  • 49
  • 1
  • 1
  • 7
  • Does [this help](https://www.wwco.com/~wls/blog/2010/10/14/reactive-framework-conflict-solved/)? Or [this one](http://stackoverflow.com/questions/2806332/visual-studio-2010-can-no-longer-build-net-v3-5)? – Ken Y-N Apr 24 '15 at 00:58
  • 2
    It looks like you are using an old version of Rx. Specifically a version that targets .net 3.5 (you seem to be running .net >4.0). You should really be using nuget to manage your dependencies for libraries like Rx. – Aron Apr 24 '15 at 01:10
  • 1
    @Aron - You should post this as the answer. It fully explains the problem and nothing further is needed. – Enigmativity Apr 26 '15 at 13:03

1 Answers1

1

You seem to have downloaded an old version of Rx which was targeting .net 3.5.

Since then much of Rx was integrated into .net 4.0 framework. To avoid the conflict you should use a version of Rx that targets the version of .net you are building for.

The easiest way to do this is to bring in the dependency using nuget, rather than downloading the binaries manually, and nuget will handle the versioning issues for you.

System.Observable.dll is not in the newest Rx because they included it into System.dll in .net 4.0 onward, which is the conflict you were finding.

Aron
  • 15,464
  • 3
  • 31
  • 64