Missing async metrics


You do not see async transactions for WebApi, HttpClient, SqlCommand, SqlDataReader, NpgsqlCommand, or custom instrumentation. This issue is particularly common for apps created under .NET Framework 4.0 or lower, then migrated to .NET Framework 4.5 or higher.


A specific appSetting or system.web setting is required if you are using:

  • WebApi1, WebApi2, or "async" methods in HttpClient, SqlCommand, SqlDataReader, or NpgsqlCommand or async-related custom transactions/instrumentation
  • New Relic .NET agent version or higher
  • .NET Framework 4.5 or higher as the target for your app

If these three conditions apply, then you need to ensure your app uses the upgraded request processing pipeline introduced in .NET 4.5.

To use the upgraded pipeline, ensure one of the following settings is present in web.config; if neither setting is present, add one:

Recommended: Tell .NET to use the new pipeline

Tell .NET to use the new ASP request processing pipeline:

    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
Specify your target framework version

Specify the .NET Framework version you target. This imposes strict runtime checks which can cause compatibility issues, so if possible you should instead tell .NET to use the new pipeline.

The specified version of the .NET Framework must be installed on your machine, and must be version 4.5.2 or higher:

    <httpRuntime targetFramework="YOUR_TARGET_NET_VERSION" /> 

Recommended: Verify compatibility with the new pipeline

Optionally, you can tell the .NET framework to perform additional checks of your async code at runtime. These checks catch common issues in async code, which may be masked by the legacy ASP pipeline. If your app passes without any issues, you can be confident that your app correctly handles the new pipeline. For more information, see Microsoft's configuration docs.

To enforce additional checks, add the following to web.config:

    <add key="aspnet:AllowAsyncDuringSyncStages" value="false" />


Async instrumentation is disabled if the legacy integrated pipeline is present. Before .NET 4.5, the integrated pipeline could cause deadlocks.

For more help

For more information about this .NET Framework bug, see:

Join the discussion about .NET monitoring in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.