Most of all are well aware about command line profiling for ASP.NET Application using VSPerfASPNETCmd command line tool . This can easily profile your ASP.NET Web applications which is hosted on IIS. We just need to run VSPerfASPNETCmd command with required parameter. Once profiling done, we can inspect the generated performance report (.vsp) file within Visual Studio. But, do you know we can do the complete profiling within Visual Studio itself. How ? Here you go.
[Note : I recorded a quick 3 min video on the same and embedded at end . ]
Start a new instance of Visual Studio 2010 and Open Performance Explorer from Analyze Menu . Click on the “New Performance Session” icon.
Image may be NSFW.
Clik here to view.
This will create a new Performance session for you with two different folders, Reports ( Which is the repository for all .vsp files ) and Targets ( Targets folder shows the binaries that are profiled in the current session )
Image may be NSFW.
Clik here to view.
Now, here is the trick, Right Click on “Targets” folder and Click on “Add Existing web Site…”
Image may be NSFW.
Clik here to view.
Below dialog will appear where have to provide the url of your application which is hosted on IIS.
Image may be NSFW.
Clik here to view.
Click on OK, you will find the associated file that targeted to your web application within the targets folder.
Image may be NSFW.
Clik here to view.
Now you can start profiling by clicking on “Start Profiling” option from the Performance session context menu.
Image may be NSFW.
Clik here to view.
Now you can see your profiling being started and checkout the targeted process Id for profiling ( In Performance output window) . Yes, it’s targeted to the worker process (w3wp.exe ) for the application which is running at IIS.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Stop profiling when you are done with the navigation of your application, you will find the generated reports under reports folder.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Now you can inspect the performance report within your visual studio itself.
Here is a quick video
Here is few useful tips and tricks on profiling.
- How to enable Tier Interaction Profiling ( TIP ) in Visual Studio 2010 Profiler ?
- Highlighting Execution Hot Path in Visual Studio 2010 Profiler Call Tree
- Create Work Item in TFS for Specific Visual Studio 2010 Profiler Report
- Setting Up Noise Reduction Option for Performance Reports in Visual Studio 2010 Profiler
- How to change Default Performance Report Name in Visual Studio 2010 ?
Hope this helps.
Cheers !
Aj