Uninstall the .NET agent

This document explains how to uninstall the New Relic .NET agent. For instructions on how to temporarily disable the agent, see Disable the agent.

To uninstall New Relic's .NET agent, follow the procedure that corresponds to your operating system and agent:

Linux: Uninstall .NET Core 2.0 agent

To uninstall the .NET Core 2.0 agent on Linux, use your package management tool.

You must restart your application once the uninstall is finished.

Uninstall with apt (Debian, Ubuntu, and Linux Mint)

Execute the following command as root:

sudo apt-get remove newrelic-netcore20-agent
Uninstall with dpkg (Debian, Ubuntu, and Linux Mint)

Execute the following command as root:

sudo dpkg --remove newrelic-netcore20-agent
Uninstall with yum (CentOS, Red Hat Enterprise Linux, Oracle Linux)

Execute the following command as root:

sudo yum remove newrelic-netcore20-agent
Uninstall with rpm (CentOS, Red Hat Enterprise Linux, Oracle Linux)

Execute the following command as root:

sudo rpm -e newrelic-netcore20-agent
Uninstall tarball
  1. Delete all New Relic files from your app folder.
  2. Unset New Relic environment variables:

    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

Windows: Uninstall .NET Core 2.0 agent

  1. Stop the application(s) being instrumented.
  2. Delete the folder containing the .NET Core 2.0 installation.
  3. Unset the following environment variables, including those set globally:
    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
  4. Restart your application.

Windows: Uninstall .NET Framework agent

Requires Administrator rights in your Windows admin group.

Standard uninstall
  1. To shut down any running agents, stop IIS. If you don't stop IIS, you may need to reboot after uninstalling the agent.
  2. Select Start > All Programs > New Relic .NET Agent > Uninstall the .NET agent.
  3. Follow the prompts to complete uninstallation.
  4. Restart IIS.

After uninstalling the agent, you may want to remove all agent-related files. Be sure to check other paths to remove any other New Relic files. For example, uninstalling the .NET Framework agent does not delete your newrelic.config file.

  1. From Control Panel > Programs > Programs and Features, right-click and delete any files named New Relic .NET Agent.
  2. Delete the entire folder at C:\ProgramData\New Relic\.NET Agent.
  3. Delete the entire folder at C:\Program Files\New Relic\.NET Agent.
  4. Delete the entire folder at C:\Program Files (x86)\New Relic\.NET Agent.
  5. Remove your app from the New Relic APM UI.
Scriptable uninstall

You can add the Force option to the uninstall script to force an uninstall without prompting to restart IIS.

Execute the following command to uninstall the .NET Framework agent:

.\uninstall.cmd

For more help

Recommendations for learning more: