Question

I want to make a remoting application.

On my server application, I added System.Runtime.Remoting library. And on my source code, I wrote:

using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

And inside my class, I wrote:

HttpServerChannel channel = new HttpServerChannel(1111);

But then I got error message:

The type or namespace name 'HttpServerChannel' could not be found (are you missing a using directive or an assembly reference?)

Can you please tell me how to solve this problem? I want to create an object from HttpServerChannel class. Thanks.

Était-ce utile?

La solution

You should check the settings of your server application project in Visual Studio if the Target Framework is set to .NET Framework 4.

If the Target Framework is set to .NET Framework 4 Client Profile, then change it to target framework named above.

The Assemblies in the Client Profile doesn´t include the server channels.

Note: If you just start developing distributed applications with .NET, then you should use Windows Communication Foundation (WCF), cause .NET Remoting has been deprecated.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top