It depends on what you need.
From the documentation of Exception.GetBaseException :
When overridden in a derived class, returns an exception that is the main cause of one or more subsequent exceptions.
Application_Error , , , , :
try {
//Lots of code, method calls, etc...
try {
throw new FooException("Foo");
} catch(FooException fe) {
throw new BarException("Bar", fe);
}
}catch(BarException be) {
throw new FooBarException("FooBar", be);
}
GetLastError FooBarException, GetLastError().GetBaseException() FooException. , , .
, Foo, Bar FooBar GetLastError InnerException