Failed to CoCreate Profiler error - but not using a profiler
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
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
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.
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)