The license key for your .NET agent can be set in one of three ways. Choose the one that works best for you.
In order of precedence (each setting will supersede the settings below it), license keys can be set:
NEW_RELIC_LICENSE_KEYenvironment variable - This can be used to set the license key system-wide, or for an individual application process. If the application’s process contains this environment variable, the .NET agent will use it for that application.
In a localized
newrelic.configfile. If you place a copy of the
newrelic.configfile in the root folder of your application, the .NET agent will load that config file for your application instead of the global config file.
In the global
newrelic.configfile - If neither of the other two settings exist for your application process, the .NET agent will fall back to the settings in the global
newrelic.configfile that shipped with the agent. For .NET Framework agents, the default location of this file is
C:\ProgramData\New Relic\.NET Agent. For .NET Core agents or agents installed with Nuget, the file will be in the directory where the agent was extracted on your system.