SharePoint24x7 It's all about SharePoint.

5Jan/140

Article – Enabling Developer Dashboard in SharePoint 2013

Posted by Joy

The Developer Dashboard was introduced in SharePoint 2010. Objective was to show performance and tracing information for a SharePoint page. It was introduced as a control on the page itself (rather MasterPage). In SharePoint 2013, the Developer Dashboard has been improved a lot. Now it opens up in a separate dedicated window and no longer a control on the page (MasterPage). It also no longer just contains information about the last request but contains information about several requests. In this version of the Developer Dashboard, we can compare multiple page requests information.

This version of the Developer Dashboard is a lot more detailed than it was in SharePoint 2010. It gives a tabify output with lot more information related to the page request. Apart from the information we got in SharePoint 2010 Developer Dashboard, SharePoint 2013 Developer Dashboard will show:

  • Service calls
  • All ULS log entries that are related to the request
  • SQL requests and the time it took to process them
  • The different scopes and execution times

By default, the Developer Dashboard is disabled. You can enable it by using Windows PowerShell. The Windows PowerShell cmdlet only supports "On" and "Off" parameters. The "OnDemand" parameter has been deprecated. However, "On" parameter now pretty much acts the way "OnDemand" did in SharePoint 2010. Just like in SharePoint 2010, it displays an icon in the upper-right corner that allows you to open up the Developer Dashboard as when needed.

Following Windows PowerShell command shows how to enable SharePoint 2013 Developer Dashbiard:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue"

$DevDashboardSettings = [Microsoft.SharePoint.Administration.SPWebService]:: ContentService.DeveloperDashboardSettings

$DevDashboardSettings.DisplayLevel = 'On'

$DevDashboardsettings.Update()

28Dec/110

Enabling Developer Dashboard in SharePoint 2010

Posted by Joy

ASP.NET provides Call Stack and Tracing as wonderful features which helps developers on investigating what is going on page rendering behind the scene. SharePoint being a product which provides bunch of features OOTB which we can use to setup a portal very easily, it hides most of these information.

Back in MOSS 2007, we had to scratch our head thinking where to start our investigation when we get an error in the browser, because that error was not descriptive enough for us to start the investigation.

In SharePoint 2010, we have a nice feature – Developer Dashboard which helps developers to be comfortable when they see an error in the browser.

Enabling Developer Dashboard

Developer Dashboard is a feature targeted for developers (administrators as well) and hence it is disabled by default. We need to enable it using one of the method mentioned below:

  • STSADM
  • PowerShell
  • SharePoint Object Model
STSADM

We still can use STSADM with SharePoint 2010 for administering SharePoint. However, STSADM is more likely to disappear in the next release. Though we can use following STSADM command to enable Developer Dashboard, I strongly recommend to get familiar with PowerShell, if you are not already.

  1. Go to the command prompt and make sure to either set the path to the location of STSADM.EXE or navigate to the bin directory in SharePoint root in your command prompt.
  2. Issue the following command in the command prompt:STSADM -o setproperty -pn developer-dashboard -pv ondemand

The above command will enable the Developer Dashboard in On Demand mode.

PowerShell
  1. Go to Start –> All Programs –> Microsoft SharePoint 2010 Products –> SharePoint 2010 Management Shell
  2. Issue the following command in the management shell:$devdash = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
    $devdash.DisplayLevel = ‘OnDemand’;
    $devdash.TraceEnabled = $true;
    $devdash.Update()

The above command will enable the Developer Dashboard in On Demand mode.

SharePoint Object Model
  1. Create a Console Application, Windows Application or Web Site and add a reference to the Microsoft.SharePoint.dll assembly.
  2. Add using Microsoft.SharePoint.Administration namespace reference at the top of the code (C#) file.
  3. Add the following code into your code (C#) file to enable Developer Dashboard:SPWebService svc = SPContext.Current.Site.WebApplication.WebService;
    svc.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.OnDemand;
    svc.DeveloperDashboardSettings.Update();

The above command will enable the Developer Dashboard in On Demand mode.

I have used On Demand as the setting for Display Level of the Developer Dashboard and following are the other options we can specify:

  1. On – Enable the Developer Dashboard all the times
  2. Off – Disable the Developer Dashboard
  3. OnDemand – Enable the Developer Dashboard but will be displayed on demand.

When you enable Developer Dashboard in On Demand mode, following icon will be displayed next to your login name.

Capture1

On click of the Developer Dashboard icon, page will be reloaded and Developer Dashboard will be displayed at the bottom of the page as shown below:

Capture2

If you have also used TraceEnabled = $true switch with PowerShell, then you will see a link says “Show or hide additional tracing information …” at the end of the Developer Dashboard which allows you to show/ hide ASP.NET Tracing information as shown below:

Capture3

Isn’t this a awesome feature for you to get started your investigation exercise? Have a closer look at what Developer Dashboard offers you and it will help you in numbers of ways.