One of the new features in CLR V4 is the ability to load your profiler without needing to register it first. In V2, we would look at the following environment variables:
COR_ENABLE_PROFILING=1
COR_PROFILER={CLSID of profiler}
and look up the CLSID from COR_PROFILER in the registry to find the full path to your profiler's DLL. Just like with any COM server DLL, we look for your profiler's CLSID under HKEY_CLASSES_ROOT, which merges the classes from HKLM and HKCU.
We mostly follow the same algorithm in V4, so you can continue registering your profiler if you wish. However, in V4 we look for one more environment variable first:
COR_PROFILER_PATH=full path to your profiler's DLL
If that environment variable is present, we skip the registry look up altogether, and just use the path from COR_PROFILER_PATH to load your DLL. A couple things to note about this: