O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Remote Exceptions

Another area where you might not expect an exception is in another AppDomain. AppDomains are isolated so that a failure in another AppDomain will not affect another AppDomain. This is still true, but with exceptions, the CLR works hard to make sure the user sees the exceptions.

The following sample in the AppDomainFault directory creates another AppDomain and causes the current thread to enter the newly created AppDomain. It does this by creating a local instance of an object that is supported by that AppDomain and calling a method on that object. The object class is shown in Listing 15.22.

Listing 15.22. AppDomain Exceptions
 public class Fault : MarshalByRefObject { public void DivideZero() { Console.WriteLine("In the application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required