When using the MSI Windows installer, it defaults to %ALLUSERSPROFILE%\New Relic\.NET Agent\Logs.
If you installed the agent with the NewRelic.Agent NuGet package, you'll find a logs folder in the directory where the agent was extracted on your system.
To check for agent logs:
Make sure you're looking at current data. Delete or move any existing files in the logs directory so that you're sure the logs you generate reflect the current state of your system.
Restart your application. If your application is hosted in IIS, run a command-line IISRESET in an admin command line prompt.
Exercise your application for at least a few minutes in a way that would generate traffic you'd expect to see in your New Relic account.
Make note of the process ID (PID) your application is running under so you can verify if a log is being created for that process. You can find the PID by using Windows Task Manager or Process Explorer.
Go back to the agent logs directory and look for a log file with a name containing the process ID of your application (for example, NewRelic.Profiler.[PID].log).
If you see that profiler log file in the logs directory, then also check to see if there is a corresponding agent log. The agent log contains the prefix newrelic_agent. If you're running multiple .NET applications on your host, there may be more than one of these. If you see one or more you must determine which corresponds to the application you're trying to monitor.
Search in the agent log for the string (pid [your PID]), for example (pid 1573). If you find that string in the log file, then you know it's the agent log associated with your application.
Look for network or other errors that could cause the agent to fail to send data to New Relic.
Step 2: Check if the .NET agent profiler is loaded into the application's process
Launch the appropriate version of Process Explorer for your environment (32 vs 64 bit) as an administrator (right-click Run as Administrator).
In the main window of Process Explorer, find the process you're trying to monitor, and make note of the number in the PID column. If you're trying to monitor an IIS-hosted web application, the process name will be w3wp.exe.
In the Process Explorer menu bar, select View > Show lower pane and then View > Lower pane view > DLLs.
Highlight your application process in the upper pane, then check the lower pane for the following DLL(s).
NewRelic.Profiler.dll - This DLL is required for the agent to monitor your application. If it is not present, please make sure that the user the application is running under has read permissions to the folder where the agent was installed.
Important
In the .NET Framework agent this should be the same as the NEWRELIC_INSTALL_PATH environment variable.
In the .NET Core agent this should be the same as the CORECLR_NEWRELIC_HOME environment variable.
mscorlib.dll: .NET Framework agent only. The presence of this DLL is how the agent identifies your app as a .NET Framework application. If it's not present, the agent ignores the app completely. If your app does not contain this DLL, please double-check to make sure your app meets the agent compatibility requirements
Important
The use of Code Access Security is compatible with the .NET agent only when Full Trust is provided. The agent is not compatible with more restrictive trust levels.
If you don't see NewRelic.Profiler.dll, continue to the next step. If you do get results, skip down to Step 4 (permissions).
Step 3: Check for required environment variables
To check for the required environment variables: Right-click on the process in Process Explorer and select Properties. You'll see a set of tabs at the top of the window that pops up. Select the Environment tab.
If the correct variables are set and the application you're trying to monitor has access to them, you should see a particular set of environment variables, depending on whether the agents you have installed are .NET Framework or .NET Core.
The environment variables that appear in the environment tab should be similar to these:
COR_ENABLE_PROFILING tells the .NET CLR that profiling should be enabled for this process. It must be set to 1 in order for any .NET Framework profiler (including our .NET agent) to function.
COR_PROFILER identifies the New Relic profiler as the profiler to load into the process. If the CLSID shown in Process Explorer does not match the one above, you have multiple profilers installed on your system and a different profiler is currently configured to monitor the process. This is known as a profiler conflict.
NEWRELIC_INSTALL_PATH tells the profiler where to find the New Relic files needed for monitoring. If you installed the agent to the default path, the path should match the entry above.
If the environment variables don't match what you see above you can re-run the .NET agent installer and select Repair when prompted to restore them to the default.
If the environment variables above are not present in the process at all, it usually means one of the following things:
IIS applications: There are permissions issues on your server which are preventing the application you're trying to monitor from accessing the registry keys where the variables are set.
Non-IIS applications: The “Instrument all .NET applications” feature was not selected when the agent was installed. Out-of-the-box, the Framework agent monitors IIS-hosted web apps. If the Instrument all .NET Applications feature is not installed, the agent will ignore all non-IIS applications that start up on your server. You can check whether the feature was installed by looking at the Windows system environment variables for the server and seeing if the above variables are set. If they're not, re-run the installer and select the Instrument all .NET applications feature when prompted.
Important
If the application you want to monitor is not hosted in IIS (such as a self-hosted Windows service), you must enable Instrument All and also explicitly enable the agent for that application, as noted in our installation docs.
If you made any changes to the environment variables, make sure to issue a command-line iisreset or restart your application process (if it's non-IIS). Then inspect the new process PID in Process Explorer in order to ensure the changes were successful.
Important
If the application name is showing up in New Relic, but no transactions are appearing, it's likely because no traffic is hitting the app, or else the agent is not encountering a known framework that it can automatically instrument.
If your application does not use one of those compatible app frameworks, you may need to custom instrument your application, in order to tell the agent what parts of your application are important for monitoring and what constitutes the scope of a transaction.
The environment variables that appear in the environment tab should be similar to these:
These variables are set manually as part of the installation process or at run time. If changes need to be made, adjust the variables in Windows or wherever you have set the variables for this application.
Details on these variables:
CORECLR_ENABLE_PROFILING tells the .NET Core Runtime that profiling should be enabled for this process. It must be set to 1 in order for any .NET Core profiler (including the .NET agent) to function.
CORECLR_PROFILER identifies the New Relic profiler as the profiler to load into the process. If the CLSID shown in Process Explorer does not match the one above, you have multiple profilers installed on your system and a different profiler is currently configured to monitor the process. This is known as a profiler conflict.
NEWRELIC_INSTALL_PATH tells the profiler where to find the New Relic files needed for monitoring. If you installed the agent to the default path, the path should match the entry above.
CORECLR_NEWRELIC_HOME is the path to the location where the .NET Core agent is installed on your system.
If you don't see the variables above in Process Explorer when inspecting your application's process, make sure you have the variables set and that they are accessible to the application at run time.
Important
If the application name is showing up in New Relic, but no transactions are appearing, it's likely because either no traffic is hitting the app, or the agent is not encountering a known framework that it can automatically instrument.
If your application does not use one of those compatible app frameworks, you may need to implement custom instrument to tell the agent what parts of your application are important for monitoring and what constitutes the scope of a transaction.
If the application you want to monitor is not hosted in IIS (such as a self-hosted Windows service), you must configure your application to be monitored by setting the following environment variable:
CORECLR_ENABLE_PROFILING=1
We recommend setting the environment variables for each application you want monitored. If you set them globally, you might instrument other .NET processes in addition to the application you want to monitor.
Make sure that the user your application process is running under has read/write/execute permissions to the directory where the .NET agent was extracted on your system (NEWRELIC_INSTALL_PATH or CORECLR_NEWRELIC_HOME), and all of its sub-directories.
If you made any changes, restart your app and go back to Step 1.
If the above steps did not address the issue, we recommend you contact support or ask for help on our Support Forum forum.