Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Relic Solution: Troubleshooting .NET Agent Installation Issues with Microsoft Process Explorer - Windows


#1

This post is targeted at users who have installed and configured the .NET Agent in a Windows environment, sent traffic to the application, and do not see any data reporting to their account.

Note: Before you go through this post, check to see if your agent is currently creating logs at C:\ProgramData\New Relic\.NET Agent\Logs (or wherever you have the agent installed) when you restart your application. If the agent is creating current logs, it is already installed correctly and this post will not help you.

In support we often use Microsoft Process Explorer to inspect a running process and make sure that all of the required variables and DLLs are in place for the agent to monitor the process. This post is intended to walk you through that process. This same process should work for both the .NET Framework agent and/or the .NET Core agent.

Before we get started, make sure the following things are true:

  • The .NET Agent is installed on the system
  • The application you are trying to monitor is running.
  • You have administrator rights to the server
  • You have downloaded and extracted <Microsoft Process Explorer> to your server.

First, 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, making sure the number in the PID column matches the <current PID of the application>. If you’re trying to monitor an IIS-hosted web application, the process name will be w3wp.

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 the agent you installed (Framework vs Core).

.NET Framework Agent

COR_ENABLE_PROFILING = 1
COR_PROFILER = {71DA0A04-7777-4EC6-9643-7D28B46A8A41}
NEWRELIC_INSTALL_PATH = C:\Program Files\New Relic\.NET Agent
  • COR_ENABLE_PROFILING tells .NET CLR that profiling should be enabled for this process. It must be set to “1” in order for any .NET Framework profiler (including the .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 and documentation on resolving the issue can be found <at this link>.

  • 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 are trying to monitor from accessing the registry keys where the variables are set. See <this documentation> for more information.

  • 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 if 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 are not, re-run the installer and select the “Instrument all .NET Applications” feature when prompted. See <this documentation> for more details.

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.

.NET Core Agent

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

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.

  • CORECLR_ENABLE_PROFILING tells .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, a different .NET Core profiler has been configured to monitor this process. Manually adjust the environment variable so that it matches the CLSID above.

  • CORECLR_NEWRELIC_HOME is the path to the location the .NET Core agent is installed on your system.

  • CORECLR_PROFILER_PATH is the path to the profiler dll on the system. There is a known issue where under some circumstances the %CORECLR_NEWRELIC_HOME% variable does not get correctly interpreted and so the path to the profiler dll is not correct. If you see the literal string %CORECLR_NEWRELIC_HOME%\NewRelic.Profiler.dll in Process Explorer (instead of the full path), adjust the variable to include the full path to the profiler dll, without the variable name.

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.

Note: If you’re using IIS as a reverse proxy via the AspNetCoreModule, the variables above need to be set as global (system) environment variables in Windows, and changes will need an iisreset to be picked up.


Check to see if the right DLLs are loaded

Once the correct environment variables are in place in your application, the final thing you’ll want to check is if the DLLs required to monitor the application have been loaded into the process.

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 DLLs.

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.

  • 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 application as a .NET application. If it is not present, the agent will ignore the application all together. If your application does not contain this DLL, please double-check to make sure the application meets the agent compatibility requirements:


Thats about it for using Process Explorer to diagnose issues with the .NET agent. I hope this has been helpful to you. Reach out and let us know if you have questions or suggestions about this.

Cheers,

Don


Relic Solution: .NET Core Agent Installation Issues - A Troubleshooting Guide
Relic Solution: .NET Framework Agent Installation Issues - A Troubleshooting Guide