Tuesday, March 13, 2007

Chris Taylor : Remoting Exceptions

Chris Taylor : Remoting Exceptions:

System.Reflection.Assembly remoting =
System.Reflection.Assembly.GetAssembly(
typeof(System.Runtime.Remoting.RemotingConfiguration) );



Type remotingConfigHandler = remoting.GetType
('System.Runtime.Remoting.RemotingConfigHandler');

Type customErrorsModes = remoting.GetType
('System.Runtime.Remoting.CustomErrorsModes');



FieldInfo errorMode = remotingConfigHandler.GetField('_errorMode',

BindingFlags.Static | BindingFlags.NonPublic);



FieldInfo mode = customErrorsModes.GetField( 'Off' );

errorMode.SetValue( null, mode.GetValue( null ) );

0 Comments:

Post a Comment

<< Home