Skip to Content
.NET Common Language Runtime Unleashed
book

.NET Common Language Runtime Unleashed

by Kevin Burton
April 2002
Intermediate to advanced content levelIntermediate to advanced
1024 pages
23h 26m
English
Sams
Content preview from .NET Common Language Runtime Unleashed

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Customizing the Microsoft® .NET Framework Common Language Runtime

Customizing the Microsoft® .NET Framework Common Language Runtime

Steven Pratschner

Publisher Resources

ISBN: 0672321246Purchase book