How can we help you today? How can we help you today?

Launch something before profiling starts

Is there an option to launch a .bat or some other kind of executable before profiling starts?
For example, I would like to delete a couple of files each time profiling starts.
mihies
0

Comments

3 comments

  • Brian Donahue
    Hi Miha,

    There is no way to automatically start a process before profiling directly from ANTS Profiler. I think the best option may be to add some code to the beginning of your application to clear out these files.

    It should be possible to detect whether the code is being profiled by using .NET code to check the COR_ENABLE_PROFILING environment variable, for instance:
    if (System.Environment.GetEnvironmentVariable("COR_ENABLE_PROFILING") !=null)
                {
                    System.IO.File.Delete("c:\\temp\\something.ini");
                }
    
    Hopefully this is somewhat helpful!
    Brian Donahue
    0
  • mihies
    Hi Brian,

    Sounds like a feasible workaround. However I hope you'll include such feature in a future release...
    mihies
    0
  • Brian Donahue
    I've raised it as a suggestion to our development team.

    Thanks!
    Brian Donahue
    0

Add comment

Please sign in to leave a comment.