2011-11-06 57 views
0

我试图实现在使用单声道2.10.6,和MonoDevelop的2.8.2 C#中的IObservable接口,和我不断收到以下错误:无法找到类型或命名空间名称'IObservable'。您是否缺少使用或指令或程序集引用?

The type or namespace name 'IObservable' could not be found. Are you missing a using or directive or assembly reference?

我使用:

  • 系统
  • System.Collections.Generic;
  • System.Collections.ObjectModel

我要引用:

  • 系统
  • System.Core程序
+1

你的目标是什么框架版本? 'IObservable'是.NET 4.0的新功能 – Oded

回答

0

看来,你必须编译.NET 4.0:

#if NET_4_0 

namespace System{ 
    public interface IObservable<out T> 
    { 
    IDisposable Subscribe (IObserver<T> observer); 
    } 
} 

#endif 

(取自this one)。

也许您还没有将.NET 4.0设置为目标框架?

相关问题