8

What is exactly is an Application Domain (AppDomain) and how is it different than a process or thread?

Jehof
  • 34,674
  • 10
  • 123
  • 155
Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
  • 1
    Possible duplicate of [I don't understand Application Domains](http://stackoverflow.com/questions/622516/i-dont-understand-application-domains) – Ian Goldby Nov 17 '15 at 09:13

2 Answers2

6

See MSDN.

Application domains provide a more secure and versatile unit of processing that the common language runtime can use to provide isolation between applications. You can run several application domains in a single process with the same level of isolation that would exist in separate processes, but without incurring the additional overhead of making cross-process calls or switching between processes. The ability to run multiple applications within a single process dramatically increases server scalability.

An AppDomain is basically an isolated execution environment for managed code.

yfeldblum
  • 65,165
  • 12
  • 129
  • 169
SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
2

An application domain is the "space" segments of code can run in. It can be used for a couple of things such as creating a sandbox when loading assemblies that you don't fully trust. It's different than a thread/process in that it houses the code that is being executed instead of actually being executed code. In a broad sense you can think of any application as an application domain.

TrueWill
  • 25,132
  • 10
  • 101
  • 150
Achilles
  • 11,165
  • 9
  • 62
  • 113