Install the .NET agent
New Relic supports the most popular .NET application implementations. Once installed, our .NET APM agent monitors your app's performance and gives you insight into that performance. Want more context? See Introduction to APM.
![Example .NET APM dashboards A screenshot of example .NET APM dashboards](/images/apm_screenshot-crop_overview-of-the-dotnet-agent.webp)
Installation options
The New Relic .NET agent has installation options for Linux, Windows, AWS elastic beanstalk, WCF, Nuget, and Azure cloud, web, and service fabric. Select your installation path using the form below for installation instructions based on your environment!
Tell us about your .NET app
Docker?
Remove existing monitors
Before installing the .NET agent, ensure that you have disabled any other monitoring agents you have to prevent interferance with .NET agent reporting.
Configure Docker
How you configure Docker to work with our .NET agent will depend on your setup. We'll give some example Docker files below but these are only examples. The Docker files are meant to accomplish the same things that our standard install procedures do.
Some notes about how to implement your Docker file:
- The .NET agent must be installed on the containers you want to monitor.
- The .NET agent must be installed and enabled at runtime.
Important
Note that Windows Nano Server images aren't supported.
Example Windows dockerfile for .NET framework application using IIS
Important
For non-IIS hosted applications:
- The
INSTALLLEVEL=50
switch must be used to set the required environment variables. - Enable the agent for your application using: application config, app name in newrelic.config, or a local newrelic.config.
FROM mcr.microsoft.com/dotnet/framework/aspnet
# Publish your application.COPY YOUR_APP_TO_BE_PUBLISHED /inetpub/wwwroot
# Download the New Relic .NET agent installerRUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;\ Invoke-WebRequest "https://download.newrelic.com/dot_net_agent/latest_release/NewRelicDotNetAgent_x64.msi"\ -UseBasicParsing -OutFile "NewRelicDotNetAgent_x64.msi"
# Install the New Relic .NET agentRUN Start-Process -Wait -FilePath msiexec -ArgumentList /i, "NewRelicDotNetAgent_x64.msi", /qn,\ NR_LICENSE_KEY=INSERT_YOUR_LICENSE_KEY
# Remove the New Relic .NET agent installerRUN Remove-Item "NewRelicDotNetAgent_x64.msi"
# Set your application nameENV NEW_RELIC_APP_NAME=INSERT_YOUR_APP_NAME
Example Windows dockerfile for .NET Core application
FROM mcr.microsoft.com/windows/servercore:ltsc2019
# Publish your application.COPY INSERT_NAME_OF_APP_TO_BE_PUBLISHED /app
# Download the New Relic .NET agent installerRUN powershell.exe [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;\ Invoke-WebRequest "https://download.newrelic.com/dot_net_agent/latest_release/NewRelicDotNetAgent_x64.msi"\ -UseBasicParsing -OutFile "NewRelicDotNetAgent_x64.msi"
# Install the New Relic .NET agentRUN powershell.exe Start-Process -Wait -FilePath msiexec -ArgumentList /i, "NewRelicDotNetAgent_x64.msi", /qn,\ NR_LICENSE_KEY=INSERT_YOUR_LICENSE_KEY
# Remove the New Relic .NET agent installerRUN powershell.exe Remove-Item "NewRelicDotNetAgent_x64.msi"
# Enable the agentENV CORECLR_ENABLE_PROFILING=1
# Set your application nameENV NEW_RELIC_APP_NAME=INSERT_YOUR_APP_NAME
# windows/servercore images may not include the .NET Core SDK or runtimeRUN dotnet sdk/runtime installer
WORKDIR /app
ENTRYPOINT ["dotnet", ".\\INSERT_YOUR_APP_NAME.dll"]
Did this doc help with your installation?
What's next?
Look for your app data in the UI
Look for your app data on the APM Summary page (it can take a few minutes).
Read the APM docs
For example, read about the Summary page, the Errors page, and the Transactions page.