Install the .NET agent using a scriptable installer

You need Administrator rights in your Windows admin group to install the New Relic .NET agent. For more information, see the permissions documentation for the .NET Framework agent or .NET Core 2.0 agent.

Windows installations only: The scriptable installer serves as a flexible, lightweight method to install the New Relic .NET agent on Windows. Use this method to install the .NET agent if you need to script an unattended deploy to a server.

Get started with the scriptable installer

The scriptable installer package contains scripts to install and uninstall the agent from a system. To get started with the scriptable installer:

  1. Verify that you meet the compatibility and requirements for the .NET agent:
  2. Download the scriptable installer package that corresponds to the type of agent you are installing. By downloading or using one of these packages, you agree to and accept the license terms.
  3. Unzip the scriptable installer package.
  4. Open a command shell and navigate into the unzipped package's folder.
  5. Follow the instructions to install the .NET Framework or the .NET Core 2.0 agent.

Install or update the .NET Framework agent with an install script

Use one of the following scripts to install or update the .NET Framework agent:

Install without using options
.\install.cmd -LicenseKey YOUR_LICENSE_KEY
Install using options
install.cmd -LicenseKey < YOUR_LICENSE_KEY> [-NoIISReset] [-InstrumentAll] [-InstallPath <path_to_install>]

Use these install options when installing the .NET Framework agent with a script:

Install options Description
LicenseKey Required. Your New Relic license key.
NoIISReset

Optional. Use this option to prevent the installer from initiating an IIS reset.

If you use this option, you need to do an IIS reset manually before New Relic starts instrumenting any IIS hosted applications.

InstrumentAll Optional. By default, the .NET Agent will instrument all IIS hosted applications. Use this option to enable instrumentation of other types of applications.
InstallPath Optional. Use this option to choose a different installation location. The default install location is C:\Program Files\New Relic.

As long as your app is receiving traffic, data should appear within a few minutes. If not, see No data appears.

Install or update the .NET Core 2.0 agent with an install script

You must have administrator rights within an elevated shell in order to perform the following:

  • Install the .NET Core 2.0 agent globally.
  • Select a custom log directory.
  • Perform an IISReset.

Use one of the following install scripts to install or update the .NET Core 2.0 Agent:

Local install
installAgent.ps1 -destination PATH -installType local -licenseKey YOUR_LICENSE_KEY \
	[-appName "YOUR_APPLICATION_NAME" -logDir "PATH_TO_CUSTOM_LOG_LOCATION"]

Set the following environment variables for each application that you want to instrument:

CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A}
CORECLR_NEWRELIC_HOME=PATH_TO_INSTALL
CORECLR_PROFILER_PATH=%CORECLR_NEWRELIC_HOME%\NewRelic.Profiler.dll
Local install using options
installAgent.ps1 -destination PATH -installType local -licenseKey YOUR_LICENSE_KEY \
	[-appName "YOUR_APPLICATION_NAME" -logDir "PATH_TO_CUSTOM_LOG_LOCATION" -X86 -ResetIIS -Force]

Set the following environment variables for each application that you want to instrument:

CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A}
CORECLR_NEWRELIC_HOME=PATH_TO_INSTALL
CORECLR_PROFILER_PATH=%CORECLR_NEWRELIC_HOME%\NewRelic.Profiler.dll
Global install (not recommended)

New Relic recommends a local install instead.

A global install might unintentionally instrument .NET Core 2.0 processes other than your apps.

installAgent.ps1 -destination PATH -installType global -licenseKey YOUR_LICENSE_KEY \
	[-appName "YOUR_APPLICATION_NAME" -logDir "PATH_TO_CUSTOM_LOG_LOCATION"]

Use these install options when installing the .NET Core 2.0 agent with a script:

Install options Description
Destination Required. The location where the agent is installed. This can be an absolute or relative path. Wrapping quotes are required.
InstallType

Required. Determines whether this is a local or global install.

LicenseKey Required. The license key associated with your New Relic account.
AppName Optional. Sets the default application name associated with your agent installation.
LogDir Optional. Sets a custom logging location for the agent. By default, the agent puts the logs directory in the install directory.
X86

Optional. Installs the 32-bit version of the agent rather than the 64-bit version. New Relic does not recommend installing the 32-bit version of the agent globally.

ResetIIS

Optional. Performs an iisreset after the installation.

Only use this if your .NET Core 2.0 app is hosted via an IIS reverse proxy.

Force

Optional. Forces the installation process to overwrite a previous install or to install into an existing folder.

This overwrites any configuration customizations. New Relic recommends backing up your configuration file and any custom instrumentation files prior to forcing an over-install.

Help Optional. Displays usage information for this script.

As long as your app is receiving traffic, data should appear within a few minutes. If not, see No data appears.

Uninstall using scriptable installer

To uninstall the .NET agent using a scriptable installer, see Update the .NET agent.

For more help

Recommendations for learning more: