.NET Core 中没有 AppDomains! 为什么? - No AppDomains in .NET Core! Why?

问题:

Is there a strong reason why Microsoft chose not to support AppDomains in .NET Core? Microsoft 选择不支持 .NET Core 中的 AppDomains 是否有充分的理由?

AppDomains are particularly useful when building long running server apps, where we may want to update the assemblies loaded by the server is a graceful manner, without shutting down the server. AppDomains 在构建长时间运行的服务器应用程序时特别有用,我们可能希望以一种优雅的方式更新服务器加载的程序集,而无需关闭服务器。

Without AppDomains, how are we going to replace our assemblies in a long running server process?如果没有 AppDomains,我们将如何在长时间运行的服务器进程中替换我们的程序集?

AppDomains also provide us a way to isolate different parts of server code. AppDomains 还为我们提供了一种隔离服务器代码不同部分的方法。 Like, a custom websocket server can have socket code in primary appdomain, while our services run in secondary appdomain.就像,自定义 websocket 服务器可以在主 appdomain 中拥有套接字代码,而我们的服务在辅助 appdomain 中运行。

Without AppDomains, the above scenario is not possible.没有 AppDomains,上述场景是不可能的。

I can see an argument that may talk about using VMs concept of Cloud for handling assembly changes and not having to incur the overhead of AppDomains.我可以看到一个论点可能会谈论使用云的 VM 概念来处理程序集更改,而不必招致 AppDomains 的开销。 But is this what Microsoft thinks or says?但这是微软的想法或说法吗? or they have a specific reason and alternatives for the above scenarios?或者他们对上述情况有特定的原因和替代方案?


解决方案:

参考: https://stackoom.com/en/question/1qPMp
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章