• SharePoint Tips
  • BoostSolutions Products
  • SharePoint Tutorial
  • Events
BoostSolutions
SharePoint Tutorial, News and Products
You are here: Home ∼ Using Developer Dashboard with SPMonitoredScope class

Using Developer Dashboard with SPMonitoredScope class

Published by Claus on July 26, 2011

The Developer Dashboard is a new feature introduced in SharePoint 2010, it can provides additional performance and tracing information that can be used to debug and troubleshoot issues with page rendering time.

How to Enable the Developer Dashboard

Open a command window to the %ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\14\BIN directory and enter the following command.
stsadm -o setproperty -pn developer-dashboard -pv on

When the dashboard is turned on you will find performance and tracing information appears at the bottom of the page. You can use the following command to disable the Developer Dashboard.
stsadm -o setproperty -pn developer-dashboard -pv off

Using Developer Dashboard with SPMonitoredScope class

In order to get the execution information of your code included in the developer dashboard output, you need to wrap the section of code with SPMonitoredScope.
Here is an example.
using (SPMonitoredScope scope = new SPMonitoredScope (“My Monitored Scope”))
{
// put code to monitor performance on here
}

As you can see, the name I used “My Monitored Scope” appear in the developer dashboard output.

Posted in SharePoint Tips and Tricks Tagged Developer Dashboard, microsoft sharepoint 2010, SPMonitoredScope
← Previous Next →

Copyright © 2025 BoostSolutions. Email: inquiry@boostsolutions.com

Powered by WordPress and Live Wire.

Scroll