General answer: "Do not do this."
Other than that, you can get a lot using performance counters. If the built-in counters do not help, you can create your own.
Among other things, performance counters can give you an idea of how to reproduce performance problems through load testing.
The next idea is to narrow down the area in which you are interested. It makes no sense to affect performance for the entire application if it is slow access to your web service.
Then make sure you apply the application, preferably using the configuration. The Enterprise Journal Logging application block is great for this, as it allows you to add a journal to the application, but it is configured. Then you can configure what information to write to the log, and where to write it.
This gives you a choice regarding how expensive the log should be: from entering the event log to entering the XML file. And you can solve all this at runtime.
Finally, you won’t be able to use dotTrace or anything else that requires restarting IIS by adding code to your running application. Not in production. The above ideas are not intended for this.
source share