简体   繁体   English

反应性扩展程序生成错误

[英]Reactive extensions build error

How do I resolve this build error please? 请问如何解决此构建错误? (Am getting it on updating my C# project to use .Net 4.0) (正在更新我的C#项目以使用.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' 'c:\\ Program Files(x86)\\ Reference Assemblies \\ Microsoft \\ Framework.NETFramework \\ v4.0 \\ mscorlib.dll和'c:\\ Program Files(x86)\\ Microsoft Reactive Extensions中都存在类型'System.IObservable' \\的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. 此外,我也确实使用nuget来安装Rx 2.2.5版本。但是我在其packages目录中看不到Sysem.Observable.dll。

You seem to have downloaded an old version of Rx which was targeting .net 3.5. 您似乎已下载了针对.net 3.5的旧版本Rx。

Since then much of Rx was integrated into .net 4.0 framework. 从那时起,许多Rx都集成到了.net 4.0框架中。 To avoid the conflict you should use a version of Rx that targets the version of .net you are building for. 为避免冲突,您应该使用针对您要构建的.net版本的Rx版本。

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. 最简单的方法是使用nuget引入依赖关系,而不是手动下载二进制文件,而nuget会为您处理版本问题。

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. System.Observable.dll不在最新的Rx中,因为它们System.dll其包含在.net 4.0及System.dll中,这是您发现的冲突。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM