• EnglishEspañol日本語한국어Português
  • Log inStart now

Install the .NET agent using NuGet

This document explains how to install the .NET agent using NuGet.

Install agent using NuGet

The NewRelic.Agent NuGet package places the New Relic agent in your application's build output directory so that the agent gets deployed with your application.

Before installing the agent using NuGet, understand these important points:

  • In order to configure environment variables and directory permissions, you must have access to the systems where you are deploying your applications.
  • If you're using NuGet to update an existing .NET agent, this will overwrite previously made changes to newrelic.config. To preserve changes, first save the config file outside of your project, then restore it after updating.


The agent's logs folder gets created as a subfolder of the newrelic folder in your application's build/publish output directory. The logs folder gets created with default permissions, meaning that it may not be writable by the agent if your app is run by a different user than the user who built/published the app. Make sure that the user your app runs as can write to the logs folder.

Here's an example of using NuGet via Visual Studio to install the .NET agent:

  1. Open your Visual Studio solution, or create a new one by selecting File > New > Project. For multi-project solutions, be sure to select the correct project (for example, a specific website project).

  2. Open the Package Manager console by selecting Tools > Library Package Manager > Package Manager Console. Set your project as the default project.

  3. From the Package Manager command prompt, type Install-Package NewRelic.Agent and press Enter. When you build your project, the .NET agent folder will be copied to your build output directory.

  4. Set environment variables (below) and any other necessary configuration. How to do this will vary, depending on your environment and system.

    For more details on these variables, as well as correct values for other installation scenarios, please see understanding .NET agent environment variables.

If your application is receiving traffic, data should appear within a few minutes. If it doesn't, see No data appears.

Did this doc help with your installation?

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.