This document explains how to install the .NET 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.
Here's an example of using NuGet via Visual Studio to install the .NET agent:
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).
Open the Package Manager console by selecting Tools > Library Package Manager > Package Manager Console. Set your project as the default project.
From the Package Manager command prompt, type
Install-Package NewRelic.Agentand press Enter. When you build your project, the .NET agent folder will be copied to your build output directory.
Set environment variables (below) and any other necessary configuration. How to do this will vary, depending on your environment and system.
If your application is receiving traffic, data should appear within a few minutes. If it doesn't, see No data appears.