marshall by value : AppDomain : Assembly C# Examples


C# Examples » Assembly » AppDomain »

 

marshall by value









    
using  System;

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

                MyClass  mbvObject  =  (MyClass)newDomain.CreateInstanceFromAndUnwrap(
                                "MainClass.exe",  
                                "MyClass");

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


        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Assembly
» AppDomain