in Education by
What is the App Domain Concept in ASP.NET?

1 Answer

0 votes
by

 ASP.NET introduces the concept of an Application Domain which is known as AppDomain for short. It can be considered as a lightweight process which is both a container and boundary. The .NET runtime uses an AppDomain as a container for code and data, just like the operating system uses a process as a container for code and data. As the operating system uses a process to isolate misbehaving code, the .NET runtime uses an AppDomain to isolate code inside a secure boundary.

The CLR can allow the multiple .NET applications to run in a single AppDomain. Mulitple Appdomains can exist in Win32 process.
 

How to create AppDomain
 
AppDomains are created using the CreateDomain method. AppDomain instances are used to load and execute assemblies (Assembly). When an AppDomain is no longer in use, it can be unloaded.
  1. public class MyAppDomain: MarshalByRefObject  
  2. {  
  3.     public string GetInfo()  
  4.     {  
  5.         return AppDomain.CurrentDomain.FriendlyName;  
  6.     }  
  7. }  
  8. public class MyApp  
  9. {  
  10.     public static void Main()  
  11.     {  
  12.         AppDomain apd = AppDomain.CreateDomain("Rajendrs Domain");  
  13.         MyAppDomain apdinfo = (MyAppDomain) apd.CreateInstanceAndUnwrap(Assembly.GetCallingAssembly()  
  14.             .GetName()  
  15.             .Name, "MyAppDomain");  
  16.         Console.WriteLine("Application Name = " + apdinfo.GetInfo());  
  17.     }  
  18. }  

Related questions

0 votes
    How can we improve the Performance of an ASP.NET Web Page?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    What is Enterprise Library in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    What is Data Cache in ASP.NET and how to use?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
0 votes
    What are the Navigations techniques in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
0 votes
    Explain Cookie-less Session in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    What is the PostBack property in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
0 votes
    What is cross-page posting in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    What are the differences between ASP.NET HttpHandler and HttpModule?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
0 votes
    What is the difference between HttpContext.Current.Items and HttpContext.Current.Session in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    What are different methods of session maintenance in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    How to use repeater control in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
...