开发者

How does an AppDomain get created?

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 app开发者_开发技巧Domain from the new which we create so how one AppDomain create another AppDomain and how clr decide which are created in which appDomain.


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.


AppDomains are usually created by hosts. Examples of hosts are Windows Shell, ASP.NET, and IE. When you run a .NET application from the command-line, the host is the Shell. Shell creates a new AppDomain for every application. AppDomains can also be explicitly created by .NET applications

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜