title: .Net Profiling API approaches
body: <p>I have a feeling I may already know the answer to this question, but I'll ask it anyway.</p>
  
  <p>Are there any <em>better</em> ways of using the .Net Profiling API than the COM/Managed C++ route?</p>
  
  <p>My reluctance to follow the suggested COM approach is as such:</p>
  
  <ul>
  <li>Effort, it's a lot of legwork to get started</li>
  <li>Don't like the magic involved in hooking up the C++ dlls, not easy to redistribute with projects</li>
  <li>Feels hard to unit test</li>
  <li>Don't want to behavior in C++. I could create an interop layer, but that's even more work</li>
  <li>Hard to debug. From what I've gathered you can't attach a debugger to the actual C++ layer, so you're back to log files and such</li>
  </ul>
  
  <p>I came across a project called <a href="http://sourceforge.net/projects/nprof" rel="nofollow noreferrer">NProf</a>, which was an attempt to wrap the API with a managed layer. Unfortunately it hasn't been updated since 2003.</p>
  
  <p>Does anyone have any leads that might help? This all just feels a bit nasty.</p>
  
  <p><strong>Clarifications:</strong></p>
  
  <ul>
  <li>This describes the API I'm referring to: <a href="http://www.blong.com/Conferences/DCon2003/Internals/Profiling.htm" rel="nofollow noreferrer">The Profiling API</a></li>
  <li>I'm using Visual Studio 2008, and v3.5 of the framework</li>
  </ul>