2011-11-06 28 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設置爲目標框架?

相關問題