Failed to CoCreate Profiler error - but not using a profiler

Go To StackoverFlow.com

28

We're getting a:

.NET Runtime version 2.0.50727.5448 - Failed to CoCreate profiler

message in the Event Viewer on our webserver, along with an accompanying:

.NET Runtime version 4.0.30319.239 - Loading profiler failed during CoCreateInstance. Profiler CLSID: '{d37a1b78-6dc5-46fc-bc31-f7c4d5a11c9c}'. HRESULT: 0x8007007e. Process ID (decimal): 224. Message ID: [0x2504].

The thing is, we're not trying to use a profiler, there are no profiler's running or installed on the server and the code makes no reference to profilers anywhere...

We've tried removing the registry keys that other's have pointed out are related to these messages but to no avail; it would seem that two of our websites/webapps are firing off the error, one using .Net2 and the other using 4, but I'm not sure where to look.

2012-04-04 14:43
by Dale
I have this problem now after uninstalling dotTrace. Was also getting errors when it was installed but not profiling which led me to uninstall it - Rush Frisby 2014-09-04 06:19


24

After much searching I found that someone had previously installed dotTrace, then uninstalled it, however the uninstall wasn't very clean and had left the registry littered with entries, though we'd removed some entries we thought could stop the problem there were more specific to that profiler.

After removing all registry entries related to dottrace and the CSID it presented we no longer have the error appearing in the event viewer.

See this answer for a script to aid in hunting down such entries: https://stackoverflow.com/a/36129656/361842

2012-04-05 08:12
by Dale
Also had this problem with Ants Performance Profiler - NoName 2013-04-22 13:08
Also had this problem with every profiler I have ever used. Which is kind of ridiculous that a product created to find errors and issues, creates an issue on your pc upon being uninstalled - Bill Blankenship 2016-07-29 16:33


15

Removing Environment variable COR_ENABLE_PROFILING (or set it to 0) from User variables (Control panel > System > Advanced system settings > Environment variables) solved my problem (Could not start MongoVUE)

2014-03-13 09:02
by Andreas


13

While removing all the references to the profiler's CLSID in the registry can't be a bad thing, you can also choose to just disable profiling by setting the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\COR_ENABLE_PROFILING to 0

2013-10-17 16:02
by Kevin Gosse
I still get the error after setting CORENABLEPROFILING to 0. Needs reboot - Rush Frisby 2014-09-04 06:21
@rushonerok I don't remember if a reboot is needed, but if you're on a 64 bit OS there's a second key to set: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\COR_ENABLE_PROFILINGKevin Gosse 2014-09-04 07:07
thats probably it. Andreas answer also works but the registry entries should be changed too. thanks - Rush Frisby 2014-09-04 13:09


9

To help find where this tool may be used, the below PowerShell code can be used to help detect environment variables and registry entries relating to the profiler:

clear-host
if (-not (get-psdrive HKU)) {
    New-PSDrive HKU Registry HKEY_USERS
    Set-Location HKU:
}
"COR_ENABLE_PROFILING: $env:COR_ENABLE_PROFILING "
"COR_PROFILER: $env:COR_PROFILER"
$GUID = $env:COR_PROFILER
@(
    "HKLM:\Software\Classes\CLSID\$GUID",
    "HKLM:\SOFTWARE\Classes\Wow6432Node\CLSID\$GUID",
    "HKLM:\SOFTWARE\Wow6432Node\Classes\CLSID\$GUID",
    "HKU:\*\Software\Classes\CLSID\$GUID"
) |
    get-item  | 
    %{$p = $_.Name;Get-ItemProperty $_.PSPath ''} | 
    select @{N='Path';E={$p}}, '(default)'

get-itemproperty 'HKLM:\SYSTEM\CurrentControlSet\Services\*\' 'Environment' -ea SilentlyContinue | 
    %{
        $serviceName = $_.PSChildName
        $x = new-object PSObject -Property @{ServiceName=$serviceName}
        $_ | select -expand Environment | 
            %{if($_ -match '^(?<Name>[^=]+)(=)?(?<Value>.*)$'){$x | Add-Member -MemberType NoteProperty -Name $matches['Name'] -Value $matches['Value']}}
        $x
    } |
    ?{$_.COR_ENABLE_PROFILING -eq 1} | 
    ft ServiceName, COR_ENABLE_PROFILING, COR_PROFILER, NEWRELIC_INSTALL_PATH -AutoSize

Hope that helps others in future.

2016-03-21 11:19
by JohnLBevan
Very useful script, thanks. In my case it seemed that Stackify Prefix was causing K2 Blackpearl's old v2 app pool to wig out and die. I uninstalled Prefix and the problem was resolved. Shame I didn't find this a couple of days ago and save myself some pain - Steve Pettifer 2016-04-22 10:33


5

regedit

  1. Using regedit do a Data search for the CLSID value in the error log
  2. Remove COR_PROFILER and its value
  3. Change Cor_Enable_Profiling=1 to Cor_Enable_Profiling=0
  4. Do not remove the Cor_Enable_Profiling setting for the following
  5. HKEY_LOCAL_MACHINE\SYSTEM\Services\WAS
  6. HKEY_LOCAL_MACHINE\SYSTEM\Services\W3SVC
  7. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\IISADMI‌​N
  8. doing so may cause IIS to fail to start. See the following for more details. https://serverfault.com/questions/210903/windows-process-activation-service-wont-start-parameter-is-incorrect-visual/210912
  9. You may also need to remove/disable additional User and System variables. Try disabling first (COR_ENABLE_PROFILING = 0) delete if error persist. Hope that helps. Thank you @Andreas and @Mike-Monkey for the initial guidance.

Environment Variables

2017-01-31 20:31
by Geovani Martinez
a note of interest, the profiler registered in your environment variables is Stackify's profiler - danatcofo 2017-02-28 22:09


1

For us COR_ENABLE_PROFILING was at multiple places

HKEY_LOCAL_MACHINE\SYSTEM\\Services\W3SVC and HKEY_LOCAL_MACHINE\SYSTEM\\Services\WAS

2015-08-07 19:49
by Mike-Monkey


0

Stackify Profiler Will also do the same thing to you. :(, I am finding it difficult to remove from the registry.

2016-10-06 15:31
by Omzig
if its running, you can use the tray app to remove the profiler from the registry with the "Disable Profiler" optio - danatcofo 2016-12-08 15:57


0

We see this problem from time to time when trying to start Windows Services.
This issue is invariably that the app.config for the executable is corrupt (not valid xml).
Double checking that your app.config is valid xml is a quick easy thing to check before heading of to edit registry settings..

2018-03-06 23:12
by Scott


0

Things did not work even after doing what mentioned in Answer from Agnes. In my case, I had my application pool set to an account and it's password was expired...

2018-08-29 19:32
by user007
Ads