AppDomain.Unload : AppDomain « System « C# / C Sharp by API






AppDomain.Unload

  
using System;
using System.Runtime.Remoting;
using System.Reflection;

class MainClass
{
  public static void Main() 
  {
    AppDomain d = AppDomain.CreateDomain("NewDomain");
    
    ObjectHandle hobj = d.CreateInstance("AnotherDomain", "SimpleObject");
    SimpleObject so = (SimpleObject) hobj.Unwrap();
    Console.WriteLine(so.Display("make this uppercase"));

    AppDomain.Unload(d);
    Console.WriteLine(so.Display("make this uppercase"));

  }

}


[Serializable]
public class SimpleObject 
{

  public String Display(String inString)
  {
    return(inString.ToUpper());
  }

}

   
    
  








Related examples in the same category

1.AppDomain.CreateDomain
2.AppDomain.CreateInstance
3.AppDomain.CreateInstanceAndUnwrap
4.AppDomain.CreateInstanceFromAndUnwrap
5.AppDomain.CurrentDomain.FriendlyName
6.AppDomain.CurrentDomain
7.AppDomain.DefineDynamicAssembly
8.AppDomain.DoCallBack
9.AppDomain.DomainUnload
10.AppDomain.FriendlyName
11.AppDomain.GetAssemblies
12.AppDomain.GetData
13.AppDomain.OnUnhandledException
14.AppDomain.ProcessExit
15.AppDomain.SetData
16.AppDomain.SetPrincipalPolicy