gpt4 book ai didi

.net - .NET Remoting 真的已被弃用吗?

转载 作者:行者123 更新时间:2023-12-02 01:30:26 26 4
gpt4 key购买 nike

每个人都在说 .NET Remoting 如何被 WCF 取代,但我想知道这到底有多准确。我还没有看到任何关于 Remoting 被弃用的官方消息,而且在我看来,在某些情况下 Remoting 比 WCF 更有意义。即使在框架的 4.0 版本中,也没有弃用任何与 Remoting 相关的对象或方法。据我了解,3.5和4.0框架中的System.AddIn使用Remoting。

有人有任何相反的官方说法吗?

文章中,Choosing Communication Options in .NET (对于 3.0,因为这是该文章的最新版本),它指出:

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.

现在,这当然是不准确的,因为 WCF 当然可以用于跨越应用程序域边界,但它是否为该场景提供了官方建议?

更新:我向 Clemens Vasters(他是拥有 Remoting 和 WCF 的团队成员)发送了这个问题:

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?

这是他的回复:

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.

最佳答案

将其称为遗留技术是更准确的描述。

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

更新:WCF 不区分 inter/intra/process/inter/intra-appdomain。如果您在 WCF 中使用单机通信,则可以使用命名管道 - 使用它应该可以在几乎所有实际场景中提供良好的性能。

各种分布式通信技术的性能比较see here .

关于.net - .NET Remoting 真的已被弃用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1294494/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com