This lets you capture an exception and re-throw it without changing the stack-trace
In .NET 4.5 there is now the ExceptionDispatchInfo class.
try
{
task.Wait();
}
catch(AggregateException ex)
{
ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
}
This works on any exception, not just AggregateException.
It was introduced due to the await C# language feature, which unwraps
the inner exceptions from AggregateException instances in order to make
the asynchronous language features more like the synchronous language features.