Profiler conflicts

Problem

The .NET Common Language Runtime (CLR) only allows one profiler to access the profiling API of a process at any given time. If another profiler is installed on the system, the New Relic profiler will not instrument any applications.

Solution

To avoid a profiler conflict, fully remove the other profiler from the environment, then ensure the IIS registry keys or system environment variables have been restored.

Exception: For conflicts with Microsoft's System Center Operations Manager (SCOM), follow the troubleshooting procedures specifically for SCOM.

1. Check for profiler conflicts.

To see if there are any profiler conflicts:

  1. Run Process Explorer as an Administrator.
  2. To find your app's process, right-click the app, then select Properties > Environment.
  3. Verify that the New Relic CLSID and environment variables are included in the w3wp.exe, service, or non-IIS app environment details:

COR_ENABLE_PROFILING=1
COR_PROFILER={71DA0A04-7777-4EC6-9643-7D28B46A8A41}
NEWRELIC_INSTALL_PATH=path\to\agent\directory

2. Compare registry keys to Process Explorer if necessary.

If the conflicting profiler has been disabled and there is still an issue, compare the registry keys to Process Explorer to see which profiler is present. On the machine where you are experiencing this issue, check the WAS and W3SVC REG for IIS apps, or check your service keys or non-IIS app keys.

To check registry keys with this... Do this...
PowerShell

If using Microsoft PowerShell, execute the following commands:

(Get-Item -Path HKLM:\SYSTEM\CurrentControlSet\services\WAS).GetValue("Environment")
(Get-Item -Path HKLM:\SYSTEM\CurrentControlSet\services\W3SVC).GetValue("Environment")
Command line

If using cmd, do the following for either WAS and W3SVC REG or for your service/non-IIS app. Here is an example for an IIS application:

  1. On the command line, enter regedit.
  2. From the Registry Editor, select HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services.
  3. If applicable, select the WAS folder. From the WAS folder's list of registry keys, double-click Environment, and verify that New Relic's CLSID and environment variables appear in the text box.
  4. If applicable, select the W3SVC folder. From the W3SVC folder's list of registry keys, double-click Environment, and verify that New Relic's CLSID and environment variables appear in the text box.
3. Restore New Relic registry keys or environment variables.

Once the conflicting profiler has been disabled, you still may need to restore the New Relic registry keys or, if using Instrument All, the system-wide environment variables.

To resolve the profiler conflict for IIS applications, either re-run the installer and use the Repair feature, or restore the registry settings manually using PowerShell:

$HKLM = 2147483650 #HKEY_LOCAL_MACHINE
$reg = [wmiclass]"\\.\root\default:StdRegprov"
$key = "SYSTEM\CurrentControlSet\Services\W3SVC"
$name = "Environment"
$value = "COR_ENABLE_PROFILING=1","COR_PROFILER={71DA0A04-7777-4EC6-9643-7D28B46A8A41}","NEWRELIC_INSTALL_PATH=C:\Program Files\New Relic\.NET Agent\"
$reg.SetMultiStringValue($HKLM, $key, $name, $value)
$key = "SYSTEM\CurrentControlSet\Services\WAS"
$name = "Environment"
$value = "COR_ENABLE_PROFILING=1","COR_PROFILER={71DA0A04-7777-4EC6-9643-7D28B46A8A41}","NEWRELIC_INSTALL_PATH=C:\Program Files\New Relic\.NET Agent\"
$reg.SetMultiStringValue($HKLM, $key, $name, $value)
iisreset

For non-IIS applications and Windows services, either re-run the installer and use the Repair feature, or manually edit the system-wide environment variables. For some Windows services, a reboot is required to pick up the new variables.

Cause

Here are some commonly reported profiler conflicts. This is not an exhaustive list of .NET profilers, as any program that uses the .NET profiling API may cause conflicts with the New Relic .NET profiler.

Profiler name Profiler identifier
App Dynamics AppDynamics.AgentProfiler
Dynatrace

DA7CFC47-3E35-4c-4e-B495-534F93B28683

B7038F67-52FC-4DA2-AB02-969B3C1EDA03

Diagnostic Policy Service 555908D1-A6D7-4695-8E1E-26931D2012F4
IntelliTrace 2AA1AA98-2CAA-4FCF-86CE-EFA007737E83
Microsoft App Insights

324F817A-7420-4E6D-B3C1-143FBED6D855

COR_PROFILER_PATH

D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Agent\MicrosoftInstrumentationEngine.dll
SCOM APM AD5651A8-B5C8-46ca-A11B-E82AEC2B8E78

For more help

Recommendations for learning more: