Not Steve Not Steve - 4 months ago 44
C# Question

.NET Remoting and multithreading inquiry

I apologize if these are bad questions, however I stumbled upon .NET remoting not too long ago and it's confusing me a little. What I've come to understand is .NET remoting is a way to call an object that is completely separate from your current program, is this correct? (My research includes reading and maybe understanding the MSDN Technical Overview of .NET Remoting).

When I stumbled upon the .NET remoting feature (here), it was because I was looking up methods for multithreading. Is .NET remoting a form of multithreading? Is it related to multithreading at all?

Thank you in advance for your time.

Answer

First of all .NET Remoting isn't a good choice if you start a new development because it was discontinued a long time ago. It's still there to provide backwards compatibility.

Since .NET 3.0, the right choice to do what did .NET Remoting has been Windows Communication Foundation.

About your concerns, .NET Remoting was a way of simulating that objects from other AppDomains and even other processes from same or other machines could co-exist like regular, offline objects in a very transparent way.

In a short summary, I would say that .NET Remoting wasn't designed for multi-threading purposes but as an inter-process communication approach.

Now with either WCF or ASP.NET Web API you can consume and emit objects between processes in the same machine or between other machines in the same or other networks. See WCF and ASP.NET Web API self-host flavors to learn how you can host a network API in your process and let other processes consume them.