none
What is APPDOMAIN? How to Use and What purpose of appDomain? RRS feed

  • Question

  • Hi to all,

    Please any one help me to know about APPDOMAIN .

    How to Use APPDOMAIN . Can any please show me one sample application using with it.

    What is purpose of APPDOMAIN ? Where I can use APPDOMAIN ?

    Thanks,

    Naga Harish .

    Tuesday, March 23, 2010 4:59 AM

Answers

  • Hi, Naga Harish:

         AppDomain is a model for scoping the execution of code and the ownership of resources. Many programming technologies and enviroments define their own unique models for this purpose. For an operating system, the model is based on processes. For Java VM, it is based on class loaders. For IIS and ASP, the scoping model is based on virtual directory.

         The .NET Framework runs on top of Microsoft Windows. This means that the .NET Framework must be built using the technologies that Windows can interface with. To begin with, all managed module and assembly files must first use the Windows Portable Executable (PE) file format and be either a Windows EXE file or a DLL.

        When delveloping the CLR, Microsoft implement it as a COM server contained inside a DLL, that is, Microsoft defiend a standard COM interface for the CLR and assigned GUIDs to this interface and the COM server.

        Any Windows application can host the CLR. When the CLR COM server initializes, it create an AppDomain. AppDomain is a logical container for a set of assemblies. The first AppDomain created when the CLR is initialized is called the default AppDomain, this AppDomain is destroyed only when the Windows process ends.

       AppDomains is quite like an operating system process. But note that a process is an abstraction created by the operating system, while an AppDomain is an abstraction created by the CLR. A given AppDomain resides in exactly one OS process, a given OS process can host multiple AppDomains.

      It is much efficient to create an AppDomain than to create an OS process. Also it is cheaper to cross AppDomain boundries than to cross process boundries.

      With CAS and AppDomain, you can run partially trusted code in a sandbox.

      AppDomain usages:

      Basic ones:

      1. AppDomain tutorials

      More complex ones:

      1. Use AppDomains To Reduce Memory Consumption in .NET applications

      2. Loading Assemblies in Separate Directories Into a New AppDomain


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Edited by SamAgain Tuesday, March 23, 2010 5:57 AM refine
    • Marked as answer by SamAgain Tuesday, March 30, 2010 11:25 AM
    Tuesday, March 23, 2010 5:47 AM
  • APPDOMAIN  class represents an application domain, which is an isolated environment where applications execute.

    How To Use: http://msdn.microsoft.com/en-us/library/system.appdomain.aspx

    Purpose: Application domain are smallest unit of isolation in a C# Program so that it doesn't effect each other. in other way as different processes executes seprately appdomains can execute seprately with in process see these link http://codebetter.com/blogs/raymond.lewallen/archive/2005/04/03/61190.aspx

    http://msdn.microsoft.com/en-us/library/2bh4z9hs(VS.71).aspx

     


    Manish Sati
    • Marked as answer by SamAgain Tuesday, March 30, 2010 11:25 AM
    Tuesday, March 23, 2010 5:49 AM

All replies

  • Hi, Naga Harish:

         AppDomain is a model for scoping the execution of code and the ownership of resources. Many programming technologies and enviroments define their own unique models for this purpose. For an operating system, the model is based on processes. For Java VM, it is based on class loaders. For IIS and ASP, the scoping model is based on virtual directory.

         The .NET Framework runs on top of Microsoft Windows. This means that the .NET Framework must be built using the technologies that Windows can interface with. To begin with, all managed module and assembly files must first use the Windows Portable Executable (PE) file format and be either a Windows EXE file or a DLL.

        When delveloping the CLR, Microsoft implement it as a COM server contained inside a DLL, that is, Microsoft defiend a standard COM interface for the CLR and assigned GUIDs to this interface and the COM server.

        Any Windows application can host the CLR. When the CLR COM server initializes, it create an AppDomain. AppDomain is a logical container for a set of assemblies. The first AppDomain created when the CLR is initialized is called the default AppDomain, this AppDomain is destroyed only when the Windows process ends.

       AppDomains is quite like an operating system process. But note that a process is an abstraction created by the operating system, while an AppDomain is an abstraction created by the CLR. A given AppDomain resides in exactly one OS process, a given OS process can host multiple AppDomains.

      It is much efficient to create an AppDomain than to create an OS process. Also it is cheaper to cross AppDomain boundries than to cross process boundries.

      With CAS and AppDomain, you can run partially trusted code in a sandbox.

      AppDomain usages:

      Basic ones:

      1. AppDomain tutorials

      More complex ones:

      1. Use AppDomains To Reduce Memory Consumption in .NET applications

      2. Loading Assemblies in Separate Directories Into a New AppDomain


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Edited by SamAgain Tuesday, March 23, 2010 5:57 AM refine
    • Marked as answer by SamAgain Tuesday, March 30, 2010 11:25 AM
    Tuesday, March 23, 2010 5:47 AM
  • APPDOMAIN  class represents an application domain, which is an isolated environment where applications execute.

    How To Use: http://msdn.microsoft.com/en-us/library/system.appdomain.aspx

    Purpose: Application domain are smallest unit of isolation in a C# Program so that it doesn't effect each other. in other way as different processes executes seprately appdomains can execute seprately with in process see these link http://codebetter.com/blogs/raymond.lewallen/archive/2005/04/03/61190.aspx

    http://msdn.microsoft.com/en-us/library/2bh4z9hs(VS.71).aspx

     


    Manish Sati
    • Marked as answer by SamAgain Tuesday, March 30, 2010 11:25 AM
    Tuesday, March 23, 2010 5:49 AM
  • I am sorry that I just started to learn this. I am still confused. Is "AppDomain" the same with "Process" in the OS?
    Technology news, reviews on computer, internet and more
    Wednesday, June 2, 2010 7:32 AM
  • yup you can say as various processes are isolated in OS similarly multiple appdomain are isolated with in a process. so u can say it's a smallest unit in execution environment of .net

    so processes are  made of one or more appdomains


    Manish Sati
    Wednesday, June 2, 2010 8:19 AM
  • Check out the sample application and usage of AppDomain
    https://blog.vcillusion.co.in/sending-events-through-application-domain-boundary/
    Tuesday, June 5, 2018 3:08 PM
  • Check out the sample application and usage of AppDomain
    https://blog.vcillusion.co.in/sending-events-through-application-domain-boundary/
    Tuesday, June 5, 2018 3:10 PM