Is .NET Remoting really deprecated?

.NetWcfRemoting

.Net Problem Overview


Everyone is saying how .NET Remoting is being replaced by WCF, but I'm wondering just how accurate that is. I haven't seen any official word that Remoting is being deprecated, and it seems to me there are certainly scenarios where Remoting makes more sense than WCF. None of the Remoting-related objects or methods have been deprecated, even in version 4.0 of the framework. It is also my understanding that System.AddIn in the 3.5 and 4.0 frameworks use Remoting.

Does anyone have any official word to the contrary?

In the article, Choosing Communication Options in .NET (for 3.0, as that's the latest version of that article), it states:

> 8 Cross-application domain communications > > If you need to support communication between objects in different application domains within the same process, you must use .NET remoting.

Now, that, of course, isn't accurate, as WCF can certainly be used to cross appdomain boundaries, but is it giving the official recommendation for that scenario?

Update: I sent Clemens Vasters (who was on the team that owns Remoting and WCF) this question:

> Clemens, I understand you're on the team that owns both remoting and wcf, and I have a couple of questions that I believe I need to go to the source for. > > First, I have a question about whether remoting is going away. Specifically, we have a rather large application that uses remoting extensively for in-process cross-appdomain communication, and I was wondering if this usage of remoting is considered "legacy". If so, will AppDomain.CreateInstance and friends be replaced with something else?

This is his reply:

> Remoting is part of the .Net Framework and as such it isn't going away. COM has been in Windows since Windows NT 3.5/Windows 95 and hasn't gone away and I don't see that going away anytime soon, either. > > That said, there is very minimal development investment going into Remoting. WCF is the successor of Remoting and supplants COM/DCOM for managed code. > > For in-process, cross-appdomain communication Remoting is the CLR's native way of communicating. If you are seeing performance issues pumping larger amounts of data or very many messages in short time, you should take a serious look at WCF and the NetNamedPipeBinding.

.Net Solutions


Solution 1 - .Net

Calling it a legacy technology is a more accurate description.

http://msdn.microsoft.com/en-us/library/72x4h507%28VS.85%29.aspx

> This topic is specific to a legacy > technology that is retained for > backward compatibility with existing > applications and is not recommended > for new development. Distributed > applications should now be developed > using the Windows Communication > Foundation (WCF).

Update: WCF doesn't distinguish between inter/intra/process/inter/intra-appdomain. If you are using single machine communication in WCF you use named pipes- using it should give good performance in virtually all realistic scenarios.

For a performance comparison of various distributed communication technologies see here.

Solution 2 - .Net

Yes. Remoting is deprecated...and it's official from Microsoft. Here's the link:

.NET Remoting

The first line in the article says in bold: > This topic is specific to a legacy technology that is retained for backward compatibility with existing applications and is not > recommended for new development. Distributed applications should now > be developed using the Windows Communication Foundation (WCF).

I thought the verbiage was 'deprecated' but apparently they refer to it as 'legacy'

Solution 3 - .Net

If you like to migrate to .NET Core you have to find another solution for Remoting anyway:

>.NET Remoting was identified as a problematic architecture. It's used for cross-AppDomain communication, which is no longer supported. Also, Remoting requires runtime support, which is expensive to maintain. For these reasons, .NET Remoting isn't supported on .NET Core, and we don't plan on adding support for it in the future.

Source: https://docs.microsoft.com/en-us/dotnet/core/porting/libraries#remoting

Solution 4 - .Net

Clemens Vasters, the Technical Lead for the Microsoft .NET Service Bus (that means both Remoting as well as WCF) talks about WCF vs. Remoting in this forum post. To summarize the post he ends up recommending WCF over Remoting.

I'm not sure if .NET 4.0 uses remoting internally but you could try sending Clemens the question... I'm sure he knows the answer.

Solution 5 - .Net

I think that now (2015) it's quite clear even for cross application domains: https://msdn.microsoft.com/en-us/library/vstudio/ms180984(v=vs.100).aspx

> Remoting Cross AppDomains > This topic is specific to a legacy > technology that is retained for backward compatibility with existing > applications and is not recommended for new development. Distributed > applications should now be developed using the Windows Communication > Foundation (WCF).

Then WCF should be used for cross application domains too.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMarkView Question on Stackoverflow
Solution 1 - .NetRichardODView Answer on Stackoverflow
Solution 2 - .NetJustin NiessnerView Answer on Stackoverflow
Solution 3 - .NetJean-ClaudeView Answer on Stackoverflow
Solution 4 - .NetJohannesHView Answer on Stackoverflow
Solution 5 - .NetArmandoView Answer on Stackoverflow