I haven't looked at this in 2.0 yet, and hope somebody can answer this for me.
One of the biggest frustrations I have with 1.0/1.1 is that the FCL exception types do not have constructors that allow you to give it an exception object that sets the inner exception. Take the following example:
C#
public Int32 Foo(string value)
{
try {
return value.Length;
} catch (NullReferenceException e) {
throw new ArgumentNullException("value", "Cannot pass Nothing as a value.", e);
}
}
VB
Public Function Foo(ByVal value As String) As Int32
Try
Return value.Length
Catch e As NullReferenceException
Throw New ArgumentNullException("value","Cannot pass Nothing as a value.", e)
End Try
End Function
The above won't compile because most exception types don't have constructors that take exception objects as parameters to set their inner exception property. Somebody please tell me this is fixed in 2.0. Or I can just go look for it myself sometime during the upcoming holidays ;)