Marshal By Reference Object : AppDomain : Assembly C# Examples


C# Examples » Assembly » AppDomain »

 

Marshal By Reference Object









    
using  System;

public  class  MyClassByRef:  MarshalByRefObject  
{
        public  string  HomeAppDomain
        {
                get
                {
                        return  AppDomain.CurrentDomain.FriendlyName;
                }
        }
}
public  class  MainClass
{
        public  static  void  Main(string[]  args)
        {
                AppDomain  newDomain  =  AppDomain.CreateDomain("My  New  AppDomain");

                MyClassByRef  mbrObject  =  
                        (MyClassByRef)newDomain.CreateInstanceFromAndUnwrap(
                                "MainClass.exe",  
                                "MyClassByRef");


                Console.WriteLine("AppDomain  of  MBR  object  =  {0}",  mbrObject.HomeAppDomain);
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Assembly
» AppDomain