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.
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
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)
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With