I have a simple API controller method
public async Task GetByDate(DateTime date, string user = null)
{
throw new InvalidOperationExce
I believe stack traces are improved on .NET 4.5.1 when running on Windows 8.1 / Server 2012 R2.
Alternatively, I do have an "Async Diagnostics" NuGet package that you can install into your project. Then add this line:
[assembly: AsyncDiagnosticAspect]
And you can use the ToAsyncDiagnosticString
extension method on the Exception
type. ToAsyncDiagnosticString
includes all the information from ToString
and then appends a "logical stack". More documentation (and the source) on GitHub.
Note that there is no support for partial trust and this works best in Debug builds.