SPWebService.ContentService.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.On; SPWebService.ContentService.DeveloperDashboardSettings.Update();