1. Visual Studio Ultimate 2012 – for debugging
2. Source code and debug information – for debugging
3. Administrative access on production (target) server
Prepare for collection
1. Download the IntelliTraceCollection.exe from the following URL: http://bit.ly/Ru0tJe
2. Create a folder on the production server (I like to create one called C:\itrace)
3. Copy the IntelliTraceCollection.exe to C:\itrace
4. Expand the IntelliTraceCollection.exe file to IntelliTraceCollection.cab using the following command under a command prompt with administrative permissions: expand /f:* IntelliTraceCollection.cab .
5. Create a folder to capture logs and give it appropriate permissions
a. (I like to create C:\itrace\logs)
b. Either use the Windows Explorer security tab to give the appropriate application pool account full control on the folder (use the account “IIS APPPOOL\DefaultAppPool”) or use the following command under a command prompt with administrative privileges: icacls c:\itrace\logs /grant "IIS APPPOOL\DefaultAppPool":(F)
Start the collection
1. Open a powershell command with administrative privileges and navigate (cd) to C:\itrace
2. First import the intellitrace powershell utilities with the following command: Import-Module .\Microsoft.VisualStudio.IntelliTrace.PowerShell.dll
3. Start capturaing the itrace files into the logs folder with the following command: Start-IntelliTraceCollection <ApplicationPool> <CollectionPlan> <FullOutputPath>
a. Example: Start-IntelliTraceCollection DefaultAppPool .\ Collection_plan.ASP.NET.trace C:\itrace\logs
4. To dump the itrace file in the logs folder create a checkpoint using the following example command: Checkpoint-IntelliTraceCollection DefaultAppPool
5. When done, stop the collection using the following example powershell command: Stop-IntelliTraceCollection DefaultAppPool
6. Copy the *.itrace files from C:\itrace\logs to your development machine with Visual Studio Ultimate 2012.
Analyze the itrace files
1. Open the itrace files in Visual Studio Ultimate 2012 and expand the “Web Requests” drop down to expose the HTTP/S requests and select the one you wish to explore, then click on the “Request Details” button.
2. You will now see the request events associated with the HTTP/S command (GET/POST/Etc.).
3. Select an event of interest and click on the “Start Debugging” button to begin debugging in Visual Studio.