Pages

Search This Blog

Wednesday, July 27, 2011

SharePoint Developer Dashboard


This posts is for the feature introduced in the SharePoint 2010 i.e.. “SharePoint Developer Dashboard” The Developer Dashboard is the UI components build in SharePoint Foundation that displays the diagnostics information that can be useful to the developer or farm administrator.
By default this feature is not enabled, this is to be done explicitly. SharePoint Developer Dashboard is enabled on a farm-wide basis.
So here is the Code snippet
Code Snippet: (Console Application)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;

namespace DeveloperDashBoard
{
class Program
{
static void Main(string[] args)
{
SPDeveloperDashboardSettings settings = SPWebService.ContentService.DeveloperDashboardSettings;
settings.DisplayLevel = SPDeveloperDashboardLevel.On;
settings.TraceEnabled = true;
settings.Update();
}
}
}
You can switch it off by using the code snippet given below
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
namespace DeveloperDashBoard
{
class Program
{
static void Main(string[] args)
{
SPDeveloperDashboardSettings settings = SPWebService.ContentService.DeveloperDashboardSettings;
settings.DisplayLevel = SPDeveloperDashboardLevel.Off;
settings.TraceEnabled = true;
settings.Update();
}
}
}
Happy SharePoint..!!!

No comments:

Post a Comment