# Troubleshooting Dynatrace OneAgent Instrumentation Issues in .NET 8 Applications

**URL:** <https://community.dynatrace.com/t/troubleshooting-dynatrace-oneagent-instrumentation-issues-in-net-8-applications/48380>\
**Category:** Troubleshooting\
**Tags:** dotnet\
**Created:** [October 17, 2024, 7:58am UTC](https://community.dynatrace.com/t/troubleshooting-dynatrace-oneagent-instrumentation-issues-in-net-8-applications/48380 "2024-10-17T07:58:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhushangholap](https://avatars.discourse-cdn.com/v4/letter/b/54ee81/32.png) [@bhushangholap](https://community.dynatrace.com/u/bhushangholap)\
**Post date:** [October 17, 2024, 7:58am UTC](https://community.dynatrace.com/t/troubleshooting-dynatrace-oneagent-instrumentation-issues-in-net-8-applications/48380/1 "2024-10-17T07:58:36Z")

</div>

Are you encountering issues with Dynatrace OneAgent instrumentation in your .NET 8 applications? Whether you’re upgrading from a previous .NET version or working with a new .NET 8 application, this guide will help you resolve common problems related to instrumentation.

#### Common Issue: Disabled Profiling

One of the primary reasons for instrumentation failures in .NET 8 applications is the configuration of certain environment variable flags. Specifically, the following flags can disable profiling:

- DOTNET\_EnableDiagnostics=0
- COMPlus\_EnableDiagnostics=0
- DOTNET\_EnableDiagnostics\_Profiler=0

These flags, when set to&nbsp;0, prevent the necessary diagnostics and profiling from being enabled in your .NET 8 environment.

#### Solution: Enable Diagnostics

To resolve this issue and ensure proper instrumentation with Dynatrace OneAgent, you need to either remove these environment variables or set them to&nbsp;1. Here’s how you can do it:

1. **Locate the Environment Variables:**
  - Check your system or application configuration for the presence of the above environment variables.

2. **Modify the Variables:**
  - If any of these variables are set to&nbsp;0, change their value to&nbsp;1.
  - Alternatively, you can remove these variables entirely if they are not required for other purposes.

3. **Restart Your Application:**
  - After making the changes, restart your .NET 8 application to apply the new settings.

By ensuring these environment variables are correctly configured, you can enable profiling and resolve instrumentation issues with Dynatrace OneAgent in your .NET 8 applications.

**Reference :**

> **[.NET environment variables - .NET CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables)**
>
> Learn about the environment variables that you can use to configure the .NET SDK, .NET CLI, and .NET runtime.

> **[Debugging profiling config settings - .NET](https://learn.microsoft.com/en-us/dotnet/core/runtime-config/debugging-profiling)**
>
> Learn about runtime settings that configure debugging and profiling for .NET apps.

---

<div class="post-metadata">

**Author:** ![MartinKulov](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/martinkulov/32/32167_2.png) [@MartinKulov](https://community.dynatrace.com/u/MartinKulov)\
**Post date:** [February 5, 2026, 9:37am UTC](https://community.dynatrace.com/t/troubleshooting-dynatrace-oneagent-instrumentation-issues-in-net-8-applications/48380/2 "2026-02-05T09:37:00Z")

</div>

Hi&nbsp;[@Michal\_Gebacki](https://community.dynatrace.com/user/44566)

Should we expect that&nbsp;DOTNET\_EnableDiagnostics is set to 1 from OneAgent automatically?

If this is not the case, looks like we need to manually set this variable to 1 for all monitored .NET processes which would increase the management overhead.

Thank you,

Martin Kulov
