Imports System
Imports System.Runtime.Remoting.Contexts
Imports Microsoft.VisualBasic
Public Class MyContextBoundClass
Inherits ContextBoundObject
Public myString As String = "test."
End Class
Public Class MyTypeDemoClass
Public Shared Sub Main()
Try
Console.WriteLine("The MarshalByRef property of {0} is {1}.", GetType(MyTypeDemoClass).Name, GetType(MyTypeDemoClass).IsMarshalByRef.ToString())
Console.WriteLine("The MarshalByRef property of {0} is {1}.", GetType(MyContextBoundClass).Name, GetType(MyContextBoundClass).IsMarshalByRef.ToString())
Catch e As Exception
Console.WriteLine("An exception occurred: " + e.Message.ToString())
End Try
End Sub 'Main
End Class 'MyTypeDemoClass