Failed to CoCreate Profiler
Published 18 December 2012
This article applies to both ANTS Performance Profiler and ANTS Memory Profiler.
If ANTS Performance/Memory Profiler is used to profile a Windows Service, it modifies the running environment of the service temporarily, then undoes the changes when profiling is stopped. If the service crashes with an unhandled exception during profiling, however, the modified environment may be left behind and the service will be permanently 'hooked' into ANTS Performance/Memory Profiler so the service will attempt to load the Profiler's "core" component at service startup time. Because ANTS Performance/Memory Profiler is not running, the following error entry is written to the application event log:Source: .NET Runtime
Category: None
Event ID: 1022
Description: .NET Runtime version 2.0.50727.832 - Failed to CoCreate profiler.
In order to restore the normal environment of the service, the registry editor must be used. Click the start bar, then 'run', then type regedit and press enter.
Look for the short name of your service in the key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
Open the key that has the same name as your service, and in the right-hand pane, right-click Environment and select Modify.
Locate the entries COR_ENABLE_PROFILING=1 and COR_PROFILER={a GUID} and remove these name/value pairs from the registry value. When the service is restarted, the error should no longer occur.