Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net Profiling API approaches

Tags:

.net

profiling

I have a feeling I may already know the answer to this question, but I'll ask it anyway.

Are there any better ways of using the .Net Profiling API than the COM/Managed C++ route?

My reluctance to follow the suggested COM approach is as such:

  • Effort, it's a lot of legwork to get started
  • Don't like the magic involved in hooking up the C++ dlls, not easy to redistribute with projects
  • Feels hard to unit test
  • Don't want to behavior in C++. I could create an interop layer, but that's even more work
  • 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

I came across a project called NProf, which was an attempt to wrap the API with a managed layer. Unfortunately it hasn't been updated since 2003.

Does anyone have any leads that might help? This all just feels a bit nasty.

Clarifications:

  • This describes the API I'm referring to: The Profiling API
  • I'm using Visual Studio 2008, and v3.5 of the framework
like image 650
James Gregory Avatar asked Nov 05 '22 21:11

James Gregory


1 Answers

You can take a look at Part-Cover. It's a code coverage tool (GPL) but it works similarly to NCover, which means it uses profiling API to do its job. Not sure how good or bad the code is, and of how much help it'll be for you (GPL may be an issue as well), but its something you may want to take a look at. It's been updated late last year and then went silent, so I'm not sure if the project is still active.

like image 196
Krzysztof Kozmic Avatar answered Nov 15 '22 10:11

Krzysztof Kozmic