2016-04-08 128 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