---
title: Enabling the .NET Profiler
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Continuous Profiler > Enabling the Profiler > Enabling the .NET
  Profiler
---

# Enabling the .NET Profiler

The profiler is shipped within Datadog tracing libraries. If you are already using [APM to collect traces](https://docs.datadoghq.com/tracing/trace_collection/) for your application, you can skip installing the library and go directly to enabling the profiler.

## Requirements{% #requirements %}

For a summary of the minimum and recommended runtime and tracer versions across all languages, read [Supported Language and Tracer Versions](https://docs.datadoghq.com/profiler/enabling/supported_versions/).

{% dl %}

{% dt %}
Supported operating systems for .NET Framework
{% /dt %}

{% dd %}
Windows 10Windows Server starting from version 2012
{% /dd %}

{% dt %}
Supported operating systems for .NET Core and .NET 5+
{% /dt %}

{% dd %}
Linux with glibc 2.17+ (for example, CentOS 7+) and musl-based (Alpine)Windows 10Windows Server starting from version 2012
{% /dd %}

{% dt %}
Serverless
{% /dt %}

{% dd %}
Azure App Service Windows and Linux - Web Apps only, Function Apps are not supported
{% /dd %}

{% dt %}
Supported .NET runtimes (64-bit applications)
{% /dt %}

{% dd %}
.NET Framework 4.6.1+.NET Core 2.1, 3.1.NET 5.NET 6.NET 7.NET 8.NET 9.NET 10
{% /dd %}

{% /dl %}

{% alert level="danger" %}
**Note:** For containers, **more than one core** is required. Read the [Troubleshooting documentation](https://docs.datadoghq.com/profiler/profiler_troubleshooting/dotnet#linux-containers) for more details.
{% /alert %}

{% dl %}

{% dt %}
Supported languages
{% /dt %}

{% dd %}
Any language that targets the .NET runtime, such as C#, F#, and Visual Basic.
{% /dd %}

{% /dl %}

The following profiling features are available in the following minimum versions of the `dd-trace-dotnet` library:

| Feature                                                                                                                                  | Required `dd-trace-dotnet` version                                                                     | Required .NET Runtime versions                                                                                                           |
| ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Wall time profiling                                                                                                                      | 2.7.0+                                                                                                 | All supported runtime versions.                                                                                                          |
| CPU profiling                                                                                                                            | 2.15.0+                                                                                                | All supported runtime versions.                                                                                                          |
| GC CPU consumption                                                                                                                       | 3.19.0+                                                                                                | .NET 5+                                                                                                                                  |
| Exceptions profiling                                                                                                                     | 2.31.0+                                                                                                | All supported runtime versions.                                                                                                          |
| Allocations profiling                                                                                                                    | 3.12.0+ / 3.28.0+                                                                                      | .NET Framework (requires Datadog Agent 7.51+ and 3.12.0+) / .NET 6+ (requires 2.18.0+ but Datadog recommends .NET10 with 3.28+).         |
| Lock Contention profiling                                                                                                                | 2.49.0+                                                                                                | .NET Framework (requires Datadog Agent 7.51+) and .NET 5+                                                                                |
| Live heap profiling                                                                                                                      | 3.28.0+                                                                                                | .NET 7+ but Datadog recommends .NET 10+.                                                                                                 |
| [Trace to Profiling integration](https://docs.datadoghq.com/profiler/connect_traces_and_profiles/#identify-code-hotspots-in-slow-traces) | 2.30.0+                                                                                                | All supported runtime versions.                                                                                                          |
| [Endpoint Profiling](https://docs.datadoghq.com/profiler/connect_traces_and_profiles/#break-down-code-performance-by-api-endpoints)      | 2.15.0+                                                                                                | All supported runtime versions.                                                                                                          |
| Timeline                                                                                                                                 | 2.30.0+ (and 3.19.0+ for outgoing HTTP requests longer than 50 ms in beta and thread start/end events) | All supported runtime versions (except .NET 5+ required for garbage collection details and .NET 7+ required for outgoing HTTP requests). |
| [Memory Leak investigation](https://docs.datadoghq.com/profiler/guide/solve-memory-leaks/)                                               | 3.33.0+                                                                                                | .NET 6+ (in preview)                                                                                                                     |

- Allocations and Lock Contention profiling for .NET Framework requires that the Datadog Agent and the profiled applications are running on the same machine.
- Due to a limitation of the .NET Framework, Allocations profiling does not show the size of the allocations. Instead, it only shows the count.
- Allocations and Live Heap profiling are available in .NET 10. For other previous versions of .NET, the statistical distribution of allocations sampling might not be accurate, so expect larger objects to be represented more often
- Continuous Profiler is not supported for AWS Lambda.
- Continuous Profiler does not support ARM64.

{% alert level="danger" %}
**Note:** Unlike APM, Continuous Profiler is not activated by default when the APM package is installed. You must explicitly enable it for the applications you want to profile.
{% /alert %}

## Installation{% #installation %}

Ensure Datadog Agent v6+ is installed and running. Datadog recommends using [Datadog Agent v7+](https://app.datadoghq.com/account/settings/agent/latest?platform=overview). The profiler ships together with the tracing library (beginning with v2.8.0), so if you are already using [APM to collect traces](https://docs.datadoghq.com/tracing/trace_collection/) for your application, you can skip installing the library and go directly to Enabling the Profiler.

Otherwise, install the profiler using the following steps, depending on your operating system.

{% alert level="danger" %}
**Note:** Datadog's automatic instrumentation relies on the .NET CLR Profiling API. Since this API allows only one subscriber, run only one APM solution in your application environment.
{% /alert %}

You can install the Datadog .NET Profiler machine-wide so that any services on the machine can be instrumented, or you can install it on a per-application basis to allow developers to manage the instrumentation through the application's dependencies. To see machine-wide installation instructions, click the **Windows** or **Linux** tab. To see per-application installation instructions, click the **NuGet** tab.

{% tab title="Linux with Single Step APM Instrumentation" %}

1. With [Single Step APM Instrumentation](https://docs.datadoghq.com/tracing/trace_collection/automatic_instrumentation/single-step-apm), there is nothing else to install. Go to Enabling the Profiler to see how to activate the profiler for an application.

{% alert level="danger" %}
**Note:** If APM was already manually installed, you must uninstall it by removing the following environment variables:- `CORECLR_ENABLE_PROFILING`- `CORECLR_PROFILER`- `CORECLR_PROFILER_PATH`- The value that points to `Datadog.Linux.ApiWrapper.x64.so` in `LD_PRELOAD`For example, if you are setting these environment variables in your dockerfile for a service, you should remove them to avoid conflicts with Single Step Instrumentation. If these environment variables are still set, the corresponding previously installed version is silently used instead of the one installed with Single Step Instrumentation.
{% /alert %}

{% /tab %}

{% tab title="Linux" %}
To install the .NET Profiler machine-wide:

1. Download the latest [.NET Tracer package](https://github.com/DataDog/dd-trace-dotnet/releases) that supports your operating system and architecture.

1. Run one of the following commands to install the package and create the .NET log directory `/var/log/datadog/dotnet` with the appropriate permissions:

   {% dl %}
   
   {% dt %}
Debian or Ubuntu
   {% /dt %}

   {% dd %}
`sudo dpkg -i ./datadog-dotnet-apm_<TRACER_VERSION>_amd64.deb && sudo /opt/datadog/createLogPath.sh`
   {% /dd %}

   {% dt %}
CentOS 7+ or Fedora
   {% /dt %}

   {% dd %}
`sudo rpm -Uvh datadog-dotnet-apm<TRACER_VERSION>-1.x86_64.rpm && sudo /opt/datadog/createLogPath.sh`
   {% /dd %}

   {% dt %}
Alpine or other musl-based distributions
   {% /dt %}

   {% dd %}
`sudo tar -C /opt/datadog -xzf datadog-dotnet-apm<TRACER_VERSION>-musl.tar.gz && sudo sh /opt/datadog/createLogPath.sh`
   {% /dd %}

   {% dt %}
Other distributions
   {% /dt %}

   {% dd %}
`sudo tar -C /opt/datadog -xzf datadog-dotnet-apm-<TRACER_VERSION>.tar.gz && sudo /opt/datadog/createLogPath.sh`
   {% /dd %}

      {% /dl %}

{% /tab %}

{% tab title="Windows" %}
To install the .NET Profiler machine-wide:

1. Install or upgrade to the latest version, using the [.NET Monitoring MSI installer](https://github.com/DataDog/dd-trace-dotnet/releases). Continuous Profiler supports 64-bit Windows, so you need the file like `datadog-dotnet-apm-<VERSION>-x64.msi`.

1. Run the installer with administrator privileges.

{% /tab %}

{% tab title="NuGet" %}

{% alert level="danger" %}
**Note:** This installation does not instrument applications running in IIS. For applications running in IIS, follow the Windows machine-wide installation process.
{% /alert %}

To install the .NET Profiler per-application:

1. Add the `Datadog.Trace.Bundle` [NuGet package](https://www.nuget.org/packages/Datadog.Trace.Bundle) to your application.

{% /tab %}

{% tab title="Azure App Service" %}

{% alert level="danger" %}
**Note:** Only Web Apps are supported. Functions are not supported.
{% /alert %}

To install the .NET Profiler per-webapp:

1. Install the Azure App Service Datadog APM Extension [for Windows](https://docs.datadoghq.com/serverless/azure_app_services/azure_app_services_windows/?tab=net#installation) or use the [Linux setup](https://docs.datadoghq.com/serverless/azure_app_services/azure_app_services_linux/?tab=nodenetphppython#setup) for your webapp.

{% /tab %}

## Enabling the Profiler{% #enabling-the-profiler %}

{% alert level="danger" %}
**Note**: Datadog does not recommend enabling the profiler at machine-level or for all IIS applications. If you do have enabled it machine-wide, read the [Troubleshooting documentation](https://docs.datadoghq.com/profiler/profiler_troubleshooting/?code-lang=dotnet#avoid-enabling-the-profiler-machine-wide) for information about reducing the overhead that is associated with enabling the profiler for all system applications.
{% /alert %}

{% tab title="Linux with Single Step APM Instrumentation" %}

With [Single Step APM Instrumentation](https://docs.datadoghq.com/tracing/trace_collection/automatic_instrumentation/single-step-apm), only `DD_PROFILING_ENABLED` must be set to activate the profiler for an application.

```gdscript3
DD_PROFILING_ENABLED=1

# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
```

Here are the supported values for `DD_PROFILING_ENABLED`environment variable:

| Value          | Description                                                                                                           |
| -------------- | --------------------------------------------------------------------------------------------------------------------- |
| `1` or `true`  | Activate the profiler.                                                                                                |
| `Auto`         | Activate the profiler if and only if (1) a trace has been created and (2) the application lasts more than 30 seconds. |
| `0` or `false` | Disable the profiler.                                                                                                 |

{% alert level="info" %}
**Note**: The Auto value is aimed to avoid short lived processes without any trace. This feature is in Preview.
{% /alert %}

{% /tab %}

{% tab title="Linux" %}

Set the following required environment variables for automatic instrumentation to attach to your application:

```gdscript3
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
CORECLR_PROFILER_PATH=/opt/datadog/Datadog.Trace.ClrProfiler.Native.so
DD_DOTNET_TRACER_HOME=/opt/datadog
LD_PRELOAD=/opt/datadog/continuousprofiler/Datadog.Linux.ApiWrapper.x64.so
DD_PROFILING_ENABLED=1

# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
```

For standalone applications, manually restart the application as you normally would.

Optional: Set up [Source Code Integration](https://docs.datadoghq.com/integrations/guide/source-code-integration/?tab=net) to connect your profiling data with your Git repositories.

A couple of minutes after you start your application, your profiles appear on the [Datadog APM > Profiler page](https://app.datadoghq.com/profiling). If they do not, refer to the [Troubleshooting](https://docs.datadoghq.com/profiler/profiler_troubleshooting/dotnet/) guide.

{% /tab %}

{% tab title="Internet Information Services (IIS)" %}

Set needed environment variables to configure and enable Profiler. To enable the Profiler for IIS applications, it is required to set the `DD_PROFILING_ENABLED` environment variable in the Registry under `HKLM\System\CurrentControlSet\Services\WAS` and `HKLM\System\CurrentControlSet\Services\W3SVC` nodes.

{% alert level="info" %}
Starting v2.14.0, you don't need to set `CORECLR_PROFILER` or `COR_PROFILER` if you installed the tracer using the MSI.
{% /alert %}

**With the Registry Editor:**

In the Registry Editor, modify the multi-string value called `Environment` in the `HKLM\System\CurrentControlSet\Services\WAS` and `HKLM\System\CurrentControlSet\Services\W3SVC` nodes and set the value data as follows:

For .NET Core and .NET 5+:

```text
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
DD_PROFILING_ENABLED=1

# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
```

{% image
   source="https://docs.dd-static.net/images/tracing/setup/dotnet/RegistryEditorCore.607d51e028270e684d9497dd26ad2602.png?auto=format"
   alt="Using the Registry Editor to create environment variables for a .NET Core application in IIS" /%}

For .NET Framework:

```text
COR_ENABLE_PROFILING=1
COR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
DD_PROFILING_ENABLED=1

# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
```

{% image
   source="https://docs.dd-static.net/images/tracing/setup/dotnet/RegistryEditorFramework.14a1d349e6a5d85fa5970fe210399182.png?auto=format"
   alt="Using the Registry Editor to create environment variables for a .NET Framework application in IIS" /%}

**Note**: the environment variables are applied for *all* IIS applications. Starting with IIS 10, you can set environment variables for each IIS application in the [`C:\Windows\System32\inetsrv\config\applicationhost.config` file](https://docs.microsoft.com/en-us/iis/get-started/planning-your-iis-architecture/introduction-to-applicationhostconfig). Read the [Microsoft documentation](https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/environmentvariables/) for more details.

Completely stop and start IIS by running the following commands as an administrator:

```cmd
net stop /y was
net start w3svc
```

{% alert level="danger" %}
**Note:** Use `stop` and `start` commands. A reset or restart does not always work.
{% /alert %}

Optional: Set up [Source Code Integration](https://docs.datadoghq.com/integrations/guide/source-code-integration/?tab=net) to connect your profiling data with your Git repositories.

A couple of minutes after you start your application, your profiles appear on the [Datadog APM > Profiler page](https://app.datadoghq.com/profiling). If they do not, refer to the [Troubleshooting](https://docs.datadoghq.com/profiler/profiler_troubleshooting/dotnet/) guide.

{% /tab %}

{% tab title="Windows services" %}

Set needed environment variables to configure and enable Profiler. To enable the Profiler for your service, it is required to set the `DD_PROFILING_ENABLED` environment variable in the Registry key associated to the service. If the profiler is running alone (the tracer is deactivated), you can optionally add the `DD_SERVICE`, `DD_ENV` and `DD_VERSION` environment variables.

{% alert level="info" %}
Starting v2.14.0, you don't need to set `CORECLR_PROFILER` or `COR_PROFILER` if you installed the tracer using the MSI.
{% /alert %}

**With the Registry Editor:**

In the Registry Editor, create a multi-string value called `Environment` in the `HKLM\System\CurrentControlSet\Services\MyService` key and set the value data to:

For .NET Core and .NET 5+:

```text
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
DD_PROFILING_ENABLED=1
DD_SERVICE=MyService

# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
```

{% image
   source="https://docs.dd-static.net/images/tracing/setup/dotnet/RegistryEditorCore.607d51e028270e684d9497dd26ad2602.png?auto=format"
   alt="Using the Registry Editor to create environment variables for a Windows service" /%}

For .NET Framework:

```text
COR_ENABLE_PROFILING=1
COR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
DD_PROFILING_ENABLED=1
DD_SERVICE=MyService

# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
```

{% image
   source="https://docs.dd-static.net/images/tracing/setup/dotnet/RegistryEditorFramework.14a1d349e6a5d85fa5970fe210399182.png?auto=format"
   alt="Using the Registry Editor to create environment variables for a Windows service" /%}

**With a PowerShell script:**

For .NET Core and .NET 5+:

```powershell
[string[]] $v = @(
    "CORECLR_ENABLE_PROFILING=1",
    "CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}",
    "DD_PROFILING_ENABLED=1",
    "DD_SERVICE=MyService",
    "DD_ENV=production",
    "DD_VERSION=1.2.3"
)
Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\Services\MyService -Name Environment -Value $v
```

For .NET Framework:

```powershell
[string[]] $v = @(
    "COR_ENABLE_PROFILING=1",
    "COR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}",
    "DD_PROFILING_ENABLED=1",
    "DD_SERVICE=MyService",
    "DD_ENV=production",
    "DD_VERSION=1.2.3"
)
Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\Services\MyService -Name Environment -Value $v
```

Optional: Set up [Source Code Integration](https://docs.datadoghq.com/integrations/guide/source-code-integration/?tab=net) to connect your profiling data with your Git repositories.

A couple of minutes after you start your application, your profiles appear on the [Datadog APM > Profiler page](https://app.datadoghq.com/profiling). If they do not, refer to the [Troubleshooting](https://docs.datadoghq.com/profiler/profiler_troubleshooting/dotnet/) guide.

{% /tab %}

{% tab title="Windows Standalone applications" %}

{% alert level="info" %}
Starting v2.14.0, you don't need to set `CORECLR_PROFILER` or `COR_PROFILER` if you installed the tracer using the MSI.
{% /alert %}

Set needed environment variables to configure and enable Profiler for a non-service application, such as console, ASP.NET (Core), Windows Forms, or WPF. To enable the Profiler for Standalone applications, it is required to set the `DD_PROFILING_ENABLED` environment variable. If the profiler is running alone (the tracer is deactivated), you can optionally set the `DD_SERVICE`, `DD_ENV` and `DD_VERSION` environment variables. The recommended approach is to create a batch file that sets these and starts the application, and run your application using the batch file.

For .NET Core and .NET 5+:

```cmd
SET CORECLR_ENABLE_PROFILING=1
SET CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
SET DD_PROFILING_ENABLED=1
SET DD_SERVICE=MyService

REM other optional environment variables
SET DD_ENV=production
SET DD_VERSION=1.2.3

REM start the application here
```

For .NET Framework:

```cmd
SET COR_ENABLE_PROFILING=1
SET COR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
SET DD_PROFILING_ENABLED=1
SET DD_SERVICE=MyService

REM other optional environment variables
SET DD_ENV=production
SET DD_VERSION=1.2.3

REM start the application here
```

Optional: Set up [Source Code Integration](https://docs.datadoghq.com/integrations/guide/source-code-integration/?tab=net) to connect your profiling data with your Git repositories.

A couple of minutes after you start your application, your profiles appear on the [Datadog APM > Profiler page](https://app.datadoghq.com/profiling). If they do not, refer to the [Troubleshooting](https://docs.datadoghq.com/profiler/profiler_troubleshooting/dotnet/) guide.

{% /tab %}

{% tab title="NuGet" %}

Set the following required environment variables for profiling to attach to your application:

```gdscript3
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
CORECLR_PROFILER_PATH=<System-dependent path>
DD_PROFILING_ENABLED=1
LD_PRELOAD=<System-dependent path>
DD_SERVICE=MyService

# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
DD_DOTNET_TRACER_HOME=<APP_DIRECTORY>/datadog
```

The value for the `<APP_DIRECTORY>` placeholder is the path to the directory containing the application's `.dll` files. The value for the `CORECLR_PROFILER_PATH` environment variable varies based on the system where the application is running:

| Operating System and Process Architecture | CORECLR_PROFILER_PATH Value                                                  | LD_PRELOAD Value                                                         |
| ----------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| Alpine Linux x64                          | `<APP_DIRECTORY>/datadog/linux-musl-x64/Datadog.Trace.ClrProfiler.Native.so` | `<APP_DIRECTORY>/datadog/linux-musl-x64/Datadog.Linux.ApiWrapper.x64.so` |
| Linux x64                                 | `<APP_DIRECTORY>/datadog/linux-x64/Datadog.Trace.ClrProfiler.Native.so`      | `<APP_DIRECTORY>/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so`      |
| Linux ARM64                               | `<APP_DIRECTORY>/datadog/linux-arm64/Datadog.Trace.ClrProfiler.Native.so`    | `<APP_DIRECTORY>/datadog/linux-arm64/Datadog.Linux.ApiWrapper.x64.so`    |
| Windows x64                               | `<APP_DIRECTORY>\datadog\win-x64\Datadog.Trace.ClrProfiler.Native.dll`       | N/A                                                                      |
| Windows x86                               | `<APP_DIRECTORY>\datadog\win-x86\Datadog.Trace.ClrProfiler.Native.dll`       | N/A                                                                      |

For Docker images running on Linux, configure the image to run the `createLogPath.sh` script:

```
RUN /<APP_DIRECTORY>/datadog/createLogPath.sh
```

Docker examples are available in the [`dd-trace-dotnet` repository](https://github.com/DataDog/dd-trace-dotnet/tree/master/tracer/samples/NugetDeployment).

For standalone applications, manually restart the application.

{% /tab %}

{% tab title="Azure App Service" %}
Follow these installation guidelines ([Windows](https://docs.datadoghq.com/serverless/azure_app_services/azure_app_services_windows/?tab=net#installation) or [Linux](https://docs.datadoghq.com/serverless/azure_app_services/azure_app_services_linux/?tab=nodenetphppython#setup)) to set `DD_PROFILING_ENABLED=1` to enable the profiler.
{% /tab %}

## Configuration{% #configuration %}

You can configure the profiler using the following environment variables. Note that most of these settings also apply to the Tracer configuration. Restart the application after any of these settings is changed.

| Environment variable                | Type    | Description                                                                                                                                                                                                                                                                                   |
| ----------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DD_ENV`                            | String  | The [environment](https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging) name, for example, `production`. If not set, will be `unspecified-environment`                                                                                                                  |
| `DD_SERVICE`                        | String  | The [service](https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging) name, for example, `web-backend`. If this is not specified, the .NET Profiler tries to determine the service name automatically from the application name (process entry assembly or process name). |
| `DD_VERSION`                        | String  | The [version](https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging) of your service. If not set, will be `unspecified-version`                                                                                                                                          |
| `DD_TAGS`                           | String  | Tags to apply to an uploaded profile. Must be a list of `<key>:<value>` separated by commas such as: `layer:api,team:intake`.                                                                                                                                                                 |
| `DD_AGENT_HOST`                     | String  | Sets the host where profiles are sent (the host running the Agent). Can be a hostname or an IP address. Ignored if `DD_TRACE_AGENT_URL` is set. Defaults to `localhost`.                                                                                                                      |
| `DD_TRACE_AGENT_PORT`               | String  | Sets the port where profiles are sent (the port where the Agent is listening for connections). Ignored if `DD_TRACE_AGENT_URL` is set. Defaults to`8126`.                                                                                                                                     |
| `DD_TRACE_AGENT_URL`                | String  | Sets the URL endpoint where profiles are sent. Overrides `DD_AGENT_HOST` and `DD_TRACE_AGENT_PORT` if set. Defaults to `http://<DD_AGENT_HOST>:<DD_TRACE_AGENT_PORT>`.                                                                                                                        |
| `DD_TRACE_DEBUG`                    | Boolean | Enables or disables debug logging (Could help in case of troubleshooting investigation). Valid values are: `true` or `false`. Defaults to `false`.                                                                                                                                            |
| `DD_PROFILING_LOG_DIR`              | String  | Sets the directory for .NET Profiler logs. Defaults to `%ProgramData%\Datadog .NET Tracer\logs\`. (Prior to v2.24, the default directory was `%ProgramData%\Datadog-APM\logs\`)                                                                                                               |
| `DD_PROFILING_ENABLED`              | Boolean | If set to `true`, enables the .NET Profiler. Defaults to `false`.                                                                                                                                                                                                                             |
| `DD_PROFILING_WALLTIME_ENABLED`     | Boolean | If set to `false`, disables the Wall time profiling. Defaults to `true`.                                                                                                                                                                                                                      |
| `DD_PROFILING_CPU_ENABLED`          | Boolean | If set to `false`, disables the CPU profiling. Defaults to `true`.                                                                                                                                                                                                                            |
| `DD_PROFILING_EXCEPTION_ENABLED`    | Boolean | If set to `true`, enables Exception profiling. Defaults to `false`.                                                                                                                                                                                                                           |
| `DD_PROFILING_ALLOCATION_ENABLED`   | Boolean | If set to `true`, enables Allocation profiling (in Preview). Defaults to `false`.                                                                                                                                                                                                             |
| `DD_PROFILING_LOCK_ENABLED`         | Boolean | If set to `true`, enables Lock Contention profiling. Defaults to `false`.                                                                                                                                                                                                                     |
| `DD_PROFILING_HEAP_ENABLED`         | Boolean | If set to `true`, enables Live Heap profiling (in Preview). Defaults to `false`.                                                                                                                                                                                                              |
| `DD_PROFILING_GC_ENABLED`           | Boolean | If set to `false`, disables Garbage Collection profiling used in Timeline user interface. Defaults to `true`.                                                                                                                                                                                 |
| `DD_PROFILING_HTTP_ENABLED`         | Boolean | If set to `true`, enables outgoing HTTP request profiling used in Timeline user interface. Defaults to `false`.                                                                                                                                                                               |
| `DD_PROFILING_HEAPSNAPSHOT_ENABLED` | Boolean | If set to `true`, enables the regular generation of a heap snapshot when an increase in memory consumption is detected. This is used in the [Memory Leak user interface](https://docs.datadoghq.com/profiler/guide/solve-memory-leaks/). Defaults to `false`.                                 |

{% alert level="danger" %}
**Note**: For IIS applications, you must set environment variables in the Registry (under `HKLM\System\CurrentControlSet\Services\WAS` and `HKLM\System\CurrentControlSet\Services\W3SVC` nodes) as shown in the Windows Service tab, above. The environment variables are applied for *all* IIS applications. Starting with IIS 10, you can set environment variables for each IIS application in the [`C:\Windows\System32\inetsrv\config\applicationhost.config` file](https://docs.microsoft.com/en-us/iis/get-started/planning-your-iis-architecture/introduction-to-applicationhostconfig). Read the [Microsoft documentation](https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/environmentvariables/) for more details.
{% /alert %}

## Further Reading{% #further-reading %}

The [Getting Started with Profiler](https://docs.datadoghq.com/getting_started/profiler/) guide takes a sample service with a performance problem and shows you how to use Continuous Profiler to understand and fix the problem.

- [Getting Started with Profiler](https://docs.datadoghq.com/getting_started/profiler)
- [Learn more about available profile visualizations](https://docs.datadoghq.com/profiler/profile_visualizations)
- [Fix problems you encounter while using the profiler](https://docs.datadoghq.com/profiler/profiler_troubleshooting/dotnet)
- [Optimize your .NET application performance with the Datadog Continuous Profiler](https://www.datadoghq.com/blog/dotnet-datadog-continuous-profiler/)
