---
title: Application hangs on startup
source: https://docs.newrelic.com/docs/apm/agents/net-agent/troubleshooting/app-hangs-on-startup
---

## Problem

When using the .NET agent, your .NET 8.x application may hang during startup due to a known runtime issue.

## Solution

This issue is caused by a [bug](https://github.com/dotnet/runtime/issues/93175) in the .NET runtime. While the bug is fixed in .NET 9, a backported fix is available for .NET 8. However, the fix introduces a breaking change and is not enabled by default.

To enable the fix, apply the following AppConfig to your application:

```json
"configProperties": {
  "System.Diagnostics.Tracing.CounterCallbackOnTimerThread": true
} 
```

You can also apply this setting by modifying your MSBuild project file or using an environment variable. For more details, refer to Microsoft's documentation on [.NET runtime configuration settings](https://learn.microsoft.com/en-us/dotnet/core/runtime-config/).
