Question

In .Net we can create AppDomain by writing

AppDomain domain = AppDomain.CreateDomain("MyDomain");

My question is, How it is created internally ? Application in which we use this code that application is running in different appDomain from the new which we create so how one AppDomain create another AppDomain and how clr decide which are created in which appDomain.

Was it helpful?

Solution

It's not quite clear what you trying to resolve.

AppDomains are created by the .Net runtime when a managed application is initialised.

When you start ABC.EXE, it gets an application domain. If you start a second instance of ABC.EXE it gets a new, separate application domain.

Now, if your ABC.EXE executes AppDomain domain = AppDomain.CreateDomain("MyDomain"); then you'll have 4 application domains, which cannot (easily) communicate with each other.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top