How to detect when running within profiler?

Code profiling for .NET Developers

Moderators: Luke Jefferson, StephenC, Alex.Davies, AndrewH, melvyn.harbour, Laura Morley

How to detect when running within profiler?

Postby KenDurden » Mon Nov 14, 2011 6: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 6:23 pm

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


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: 53
Joined: Wed Oct 12, 2011 12:44 pm
Location: Cambridge

Return to ANTS Performance Profiler 6

Who is online

Users browsing this forum: No registered users and 0 guests