The dnprofiler sample is derived from an "Under The Hood" article by Matt Pietrek on the Microsoft® Developer Network® (MSDN) (msdn.microsoft.com). The source code was modified to support the Shared Source CLI (SSCLI) by removing the dependency on the registry and adding a new environment variable.
Information on the Microsoft® .NET Framework profiling APIs is available in the Profiling.doc file in the Microsoft® .NET Framework SDK, in the Tool Developers Guide\docs directory. Consult the MSDN article for more information on the functionality provided by this sample and the profiling API.
This sample differs from the code described by the MSDN article in the use of COM and the registry. The COM registration is replaced by an environment variable, COR_PROFILER_DLL, in profiler_on.bat that contains the path to the DNProfiler.dll on Microsoft® Windows®.
The SSCLI version of the sample also doesn't support the DN_PROFILER_BREAK option which causes a break point when the profiler is initialized. To obtain similar functionality, set a breakpoint in CProfilerCallback::Initialize(IUnknown * pICorProfilerInfoUnk) in profilercallback.cpp.
To use this sample on FreeBSD, create a script that sets the same environment variables found in profiling_on.bat. Set the COR_PROFILER_DLL environment variable to contain the path to the libdnprofiler.so dynamic library file.
To use this sample use the following steps:
build.build.Copyright (c) 2002 Microsoft Corporation