How to detect when running within profiler?

Code profiling for .NET Developers

How to detect when running within profiler?

Postby KenDurden » Mon Nov 14, 2011 5:25 pm

Is it possible for the code to detect that it is running from within the profiler? I have certain areas of my code which have to be modified in order to work with the profiler, but which I do not want to leave as production changes.
Posts: 2
Joined: Mon Nov 14, 2011 5:23 pm

Postby dene.boulton » Tue Nov 15, 2011 11:12 am


If you are just interested in if ANTS is profiling then you could check if the following environment variables are set:


Dene Boulton
Red Gate
Posts: 42
Joined: Wed Oct 12, 2011 11:44 am
Location: Cambridge

Return to ANTS Performance Profiler Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests