2013-03-02 62 views
1

在我的窗戶形式「System.ServiceModel.OperationContext」不包含在另一個項目中,我加入這一個構造函數「0」參數錯誤

private OperationContext op = new OperationContext(); 

其沒有給出錯誤,但

的代碼(同機,同.NET版本)線它給

「System.ServiceModel.OperationContext」不包含一個構造 該取「0」參數

錯誤任何一個可以幫助我嗎?

+0

我知道這是一個愚蠢的問題,但在你的WinForms項目..是​​的OperationContext真正從System.ServiceModel的人嗎?由於文檔(http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext.aspx)說,只有一個構造函數,它需要類型IContextChannel'的'參數。前往的OperationContext的定義在WinForm,看看導致彷彿它真的是從System.ServiceModel,然後我很驚訝它編譯。 – Matt 2013-03-02 14:46:06

回答

0

那麼也許有不同的OperationContext類?您完全符合條件的人只有一個constructor確實需要參數。

相關問題