ssudaraka
ssudaraka

Reputation: 325

TcpChannel could not be found

I'm following a lab tutorial on .NET remoting and for that I need to create TcpChannel object. For that I have added using System.Runtime.Remoting namespace but it still gives me an error The type or namespace name 'TcpChannel' could not be found (are you missing a using directive or an assembly reference?)

I'm using Visual Studio 2015 Community Edition. I can't figure out what is causing this problem. I even googled it. Here's my code

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);

        }
    }
}

Upvotes: 1

Views: 3337

Answers (1)

IS4
IS4

Reputation: 13207

The TcpChannel class is located in System.Runtime.Remoting.Channels.Tcp, so you have to get using that. Also check if you reference System.Runtime.Remoting.dll in your project.

Upvotes: 2

Related Questions