2016-04-08 116 views
0

我正在關注.NET遠程處理實驗教程,爲此我需要創建TcpChannel對象。對於我所使用System.Runtime.Remoting名稱空間的加入,但它仍然給我一個錯誤類型或命名空間名稱「的TcpChannel」找不到(是否缺少using指令或程序集引用?)TcpChannel無法找到

我正在使用Visual Studio 2015社區版。我無法弄清楚是什麼導致了這個問題。我甚至GOOGLE了它。這裏是我的代碼

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Runtime.Remoting; 

namespace RemotingServer 
{ 
    class Program 
    { 
     static void Main(string[] args) 
     { 
      TcpChannel channel = new TcpChannel(8001); 

     } 
    } 
} 

回答

1

TcpChannel類位於System.Runtime.Remoting.Channels.Tcp,所以你必須讓using這一點。另外檢查你是否在你的項目中引用System.Runtime.Remoting.dll