I've read about this on the Microsoft website . Would it be interesting to have a succinct answer here in Portuguese with a summary of what it is?
Is there anything important that is not in the documentation?
I've read about this on the Microsoft website . Would it be interesting to have a succinct answer here in Portuguese with a summary of what it is?
Is there anything important that is not in the documentation?
The AppDomain, or application domain, is more or less as if it were a process within another process. It has a certain isolation from the other AppDomains. It is not much used, but it is useful especially if you have some plugin system in the application. How can you run a code that does not have control relatively securely? The answer is AppDomain. If the code of an AppDomain breaks it does not break the whole process.
The security levels of each can be set independently, so some AppDomain may be prohibited from doing certain operations by creating a sandbox .
Another advantage of it is that it can be loaded or unloaded on demand without occupying memory without need or can be just paused. You can load assemblies from different versions as already mentioned in my previous answer.
Communication is serialized, so there is little or no advantage over having another process at that point. There is no memory sharing, just like in the process. Threads are shared between them, and this is a huge difference to the process. It's a bit cheaper than a full process, it works almost like a thread without sharing the memory directly.
It is complex, unless you have a very important case to use, stay away from it. If it is created it is with the class AppDomain
.