Example #1
0
        static void Main(string[] args)
        {
            String filename = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;

            RemotingConfiguration.Configure(filename);

            IRemoteExceptionTest tst = (IRemoteExceptionTest)RemotingHelper.CreateProxy(typeof(IRemoteExceptionTest));

            try
            {
                tst.TestException();
            }
            catch (RemotingException ex)
            {
                Console.WriteLine("-- Remoting Exception");
            }
            catch (ConcurrencyException ex)
            {
                Console.WriteLine("-- Concurrency " + ex.DatabaseTable);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.GetType().Name);
            }



            Console.ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            String filename = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;

            RemotingConfiguration.Configure(filename);

            try
            {
                IRemoteExceptionTest tst = (IRemoteExceptionTest)RemotingHelper.CreateProxy(typeof(IRemoteExceptionTest));
                tst.TestException();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Test " + ex.ToString());
            }

            Console.ReadLine();
        }