Until yesterday, IntelliTrace in production environment was not supported, so the usefulness of it was a bit argued.
But now with Visual Studio 11, we can collect IntelliTrace logs from production environment in a completely supported way! And moreover, if you ask the Microsoft CSS (Customer Support Service) for help, the first question would be: “May you send me the IntelliTrace log please?”
Before of configuring IntelliTrace logs collection, we have to set security for the IIS Application pool account:
icacls sitepath “IIS APPPOOL\<AppPool Account>”:(F)
Then, hands on the bits. Suppose we have a web application throwing an exception.
Firstly, we have to deploy IntelliTrace to the target environment. Pretty easy, just extract content from the IntelliTraceCollection.cab file you can find under the C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\11.0.0 path.
Then we have to extract it to the target server. I suggest using the expand command from a command prompt:
expand.exe /f:* IntelliTraceCollection.cab path
Lastly, bring up PowerShell:
We have to load the IntelliTrace PowerShell Module:
Import-Module sitepath\Microsoft.VisualStudio.IntelliTrace.PowerShell.dll
After doing so, we can get the full list of commands we can use:
Get-Command *IntelliTrace*
And now we collect logs about the target application:
Start-IntelliTraceCollection ApplicationPool CollectionPath OutputPath
CollectionPath is the path we chose for IntelliTrace. In there, there are two “profiles”: collection_plan.ASP.NET.default.xml which collects only IntelliTrace events, and collection_plan.ASP.NET.trace.xml, which traces also function calls and events.
OutputPath is where we store logs.
After deciding Yes (to all ) we have to run the application.
When we got the error, we have to snapshot the log file:
Checkpoint-IntelliTraceCollection ApplicationPool
And then we have to stop collecting it.
Stop-IntelliTraceCollection ApplicationPool
That’s all: we have the logs.
To analyse them, it’s just a classic IntelliTrace analysis as we always did.