---
title: Name your .NET application
source: https://docs.newrelic.com/docs/apm/agents/net-agent/configuration/name-your-net-application
---

[New Relic's .NET agent](https://docs.newrelic.com/docs/agents/net-agent/getting-started/introduction-new-relic-net) gives you several ways to change the application name reported and displayed in APM. This document gives you an overview of those naming options.

For a general overview of APM app naming (not .NET-specific), see [Name your application](https://docs.newrelic.com/docs/agents/manage-apm-agents/app-naming/name-your-application). To change an application's name without breaking data continuity, use the [UI alias-change option](https://docs.newrelic.com/docs/agents/manage-apm-agents/app-naming/name-your-application#differences).

## Set your app name (recommended method) [#naming-options]

When you first deploy your app, you can change the default name to a more descriptive one. Since New Relic collects metrics using these names, customizing them allows you to run the same application on multiple hosts and get metrics from all their instances.

Typically, configuring your app-local `newrelic.config` file is the most convenient naming method.

| Naming method                                                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Recommended: Configure your app-local `newrelic.config` file | This method lets you give your app a unique name with specific configuration settings. It also works for both IIS and non-IIS hosted apps. - Copy the `newrelic.config` file from the agent home directory into your app's root folder. **Default:** `%ALLUSERSPROFILE%\New Relic\.NET Agent` - Open the copy and set your app name as follows: ```xml <application>     <name>App Name</name> </application> ``` - Restart your application. |

As long as your app is active, data should appear within a few minutes. If not, follow our [troubleshooting procedures](https://docs.newrelic.com/docs/agents/net-agent/troubleshooting/no-data-appears-net).

## Other methods

If you have a specific use or purpose in mind, you may prefer a different naming method. Here's a full list of the alternative methods:

> #### ⚠️ IMPORTANT
>
> Some methods [take precedence](https://docs.newrelic.com/docs/agents/net-agent/configuration/net-agent-configuration#config-options-precedence) over others. Before choosing a naming method, make sure you understand how your configurations may be affected.

| Naming method                            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Configure your `web.config` file         | If you have apps hosted on IIS and prefer not to have a local `newrelic.config` file, you can configure the naming settings in your `web.config` file. **Steps** **For .NET Framework apps:** - Add the following entry to the `appSettings` section of your file, and then restart your application. ```xml <appSettings>     <add key="NewRelic.AppName" value="App Name" /> </appSettings> ``` **For .NET Core apps:** - Add the `NEW_RELIC_APP_NAME` environment variable to your file as follows, and then restart your application. ```xml <aspNetCore processPath="dotnet" arguments=".\MyApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" >     <environmentVariables>         <environmentVariable name="NEW_RELIC_APP_NAME" value="App Name" />     </environmentVariables> </aspNetCore> ``` |
| Set app name using environment variables | If you want to easily set app names during the deployment of containers, set an environment variable in the application's environment. **Steps** - Set the environmental variable `NEW_RELIC_APP_NAME` in your application's environment: ```ini NEW_RELIC_APP_NAME = "App name" ``` > #### ⚠️ IMPORTANT > > This method only works if you're using .NET agent [version 6.17.387.0 or higher](https://docs.newrelic.com/docs/release-notes/agent-release-notes/net-release-notes).                                                                                                                                                                                                                                                                                                                                                              |
| Name after app pools                     | If your IIS application pools already have unique names you like, or if you're using a [shared network content infrastructure (SNCI)](https://www.iis.net/learn/web-hosting/scenario-build-a-web-farm-with-iis-servers), you can name your app after its assigned app pool. **Steps** - Remove any `NewRelic.AppName` keys from the `<appSettings>` section in `web.config.` Make sure not to delete the surrounding `<appSettings>` tags. - Remove any `<name>` child elements from the `<application>` parent element in `newrelic.config`. Make sure not to delete the surrounding `<application>` tags. ```xml <application>     <!-- <name>App Name</name> --> </application> ``` Each app will then report according to its app pool name.                                                                                                |
| Configure your `app.config` file         | If you have applications not hosted on IIS and prefer not to have a local `newrelic.config` file, you can configure the naming settings in your `app.config` file. **Steps** - Add the following entry to your `app.config` file (for example, `applicationname.exe.config`), and then restart your application. ```xml <appSettings>     <add key="NewRelic.AppName" value="App Name" /> </appSettings> ```                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Use the .NET agent API                   | If you want to rename your app programmatically, you can use the [`SetApplicationName()` agent API call](https://docs.newrelic.com/docs/apm/agents/net-agent/net-agent-api/set-application-name/) to set the app name at run time. This name will take priority over all other application naming sources.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

As long as your app is active, data should appear within a few minutes. If not, make sure you've performed an `IISRESET` from an administrative command prompt if you've changed your [.NET app's configuration file](https://docs.newrelic.com/docs/agents/net-agent/installation-and-configuration/net-agent-configuration) (`newrelic.config` or `app.config`). Otherwise, follow our [troubleshooting procedures](https://docs.newrelic.com/docs/agents/net-agent/troubleshooting/no-data-appears-net).

## Use multiple app names [#multiple]

You can use multiple app names to aggregate data from your applications. We sometimes call this "rolling up" your data.

For the .NET agent, you can set up to three application names. The first name is the primary application name, and the second and third names are used for the more general data aggregation categories. For more about how multiple app names work, see [Use multiple app names](https://docs.newrelic.com/docs/agents/manage-apm-agents/app-naming/use-multiple-names-app).

**`newrelic.config` file**

Here's an example of setting multiple names in your app-local `newrelic.config` file:

````xml
<application>
    <name>Primary App Name</name>
    <name>Second App Name</name>
    <name>Third App Name</name>
</application>
```

````

**`web.config` file**

Here's an example of setting multiple names in your `web.config` file:

````xml
<appSettings>
    <add key="NewRelic.AppName" value="App Name, App Name 2, App Name 3" />
</appSettings>
```

````

**`app.config` file**

Here's an example of setting multiple names in your `app.config` file:

````xml
<appSettings>
    <add key="NewRelic.AppName" value="App Name, App Name 2, App Name 3" />
</appSettings>
```

````

**`NEW_RELIC_APP_NAME` environment variable**

Here's an example of setting multiple names in the `NEW_RELIC_APP_NAME` environment variable:

````
NEW_RELIC_APP_NAME="App Name, App Name 2, App Name 3"
```

````
