What is an Appdomain?

Asked

Viewed 178 times

5

I read about it on the Microsoft website. It would be interesting to have a succinct answer here in Portuguese with a summary of what is?

There’s something important that’s not in the documentation?

1 answer

4


The Appdomain, or application domain, is more or less like a process within another process. It has a certain isolation from other Appdomains. It is not widely used, but it is useful especially if it has some system of plugin in the application. How can you execute a code that has no relatively safe control? 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 defined independently, so some Appdomain may be prohibited from doing certain operations by creating one sandbox.

Another advantage of it is that it can be loaded or unloaded on demand not occupying memory without need or can only be paused. It can load assemblies different versions as I’ve been saying in my previous answer.

Communication is done serialized, so there is little or no advantage to having another process at that point. No memory sharing, just like in the process. Threads are shared between them, and this is a huge difference to the process. It is a little cheaper than a complete process, works almost like a thread without sharing memory directly.

It is complex, unless you have a very important case to use, stay away from it. Creating is with the class AppDomain.

The . NET Core does not have this mechanism, and how he is the only future should not be used.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.