什么是应用域? [英] What is AppDomain?

查看:28
本文介绍了什么是应用域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是AppDomain?AppDomains 有什么好处或为什么微软带来了AppDomains的概念,没有AppDomains有什么问题?

What is an AppDomain? What are the benefits of AppDomains or why Microsoft brought the concept of AppDomains, what was the problem without AppDomains?

请详细说明.

推荐答案

AppDomain 在进程内提供了一层隔离.您通常认为的每个程序"(静态变量等)的所有内容实际上都是每个 AppDomain.这对以下情况很有用:

An AppDomain provides a layer of isolation within a process. Everything you usually think of as "per program" (static variables etc) is actually per-AppDomain. This is useful for:

  • 插件(您可以卸载AppDomain,但不能卸载AppDomain的程序集)
  • 安全性(您可以运行一组具有特定信任级别的代码)
  • 隔离(您可以运行不同版本的程序集等)
  • plugins (you can unload an AppDomain, but not an assembly within an AppDomain)
  • security (you can run a set of code with specific trust levels)
  • isolation (you can run different versions of assemblies etc)

痛苦的是你需要使用远程处理等

The pain is you need to use remoting etc.

有关更多信息,请参阅 MSDN.老实说,这不是你需要经常搞砸的东西.

See MSDN for lots more info. To be honest, it isn't something you need to mess with very often.

这篇关于什么是应用域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆