Profiling ASP.NET website in Visual Studio with Performance Wizard

Those who use Visual Studio 2010 may know that it now ships with a performance analysis tool that instruments your application in various ways.

You can run from Analyze > Launch Performance Wizard

Launch_perf

 

 

 

 

If you are profiling an ASP.NET website project then you must open it from File > Open Website > Local IIS

local_iis

 

Though there is one problem, if you do not have the right options enabled in Windows you might get an exception that reads

Error
VSP 7008: ASP.net exception: "The website metabase contains unexpected information or you do not have permission to access the metabase.  You must be a member of the Administrators group on the local computer to access the IIS metabase. Therefore, you cannot create or open a local IIS Web site.  If you have Read, Write, and Modify Permissions for the folder where the files are located, you can create a file system web site that points to the folder in order to proceed."

On this Visual Studio Profiler team blog post I found the right options that I needed to enable.

To check this in Windows 7:

  1. Open ‘Control Panel\Programs\Programs and Features’ (or run ‘appwiz.cpl’).
  2. Choose ‘Turn Windows features on or off’.
  3. In the ‘Internet Information Services’ section, make sure that the following options are selected.

After selecting the options re-launch the profiler, Visual Studio builds the solution, launches a browser window, browse some of the pages of your website while Visual studio records in the background, close the browser or hit Stop in visual studio to get the report.

Hope it helps you, let me know.