SharePoint开发者仪表盘

1、开发者仪表
  • 功能是Developer Dashboard,一旦打开开关,系统会增加一个webpart在页面的底部,到开发时必要的信息,
  • 透露的信息远远超过加载时间,
    1:显示了整个调用过程 - 这个对debug非常有用。
    2:显示了对数据库的调用过程
    3:显示了被触发的事件(event), 那个环节花费了较多的时间 .
    4:显示了被套用的服务(service)
    5:显示当前用户,当前页面状态,等等。
  • 用  C#  来打开这个开关
             SPWebService spws = SPWebService.ContentService;

            SPDeveloperDashboardSettings spset = spws.DeveloperDashboardSettings;

            spset.DisplayLevel = SPDeveloperDashboardLevel.Off;

            spset.Update();

  • 用VB来打开这个开关 

        Imports System
        Imports Microsoft.SharePoint
        Imports Microsoft.SharePoint.Administration

        Module Module1

        Sub Main()
            Dim ContentService As SPWebService = SPWebService.ContentService
            Dim developerDashboard As New SPDeveloperDashboardSettings()
            developerDashboard = ContentService.DeveloperDashboardSettings
            developerDashboard.DisplayLevel = SPDeveloperDashboardLevel.On
            developerDashboard.Update()
            Console.WriteLine("Developer Dashboard UPdated!")
        End Sub

    End Module      

  • PowerShell,在sharepoint 2010 Products的

    $snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'} 
    if ($snapin -eq $null) 
    {
        Write-Host "Loading Microsoft SharePoint Powershell Snapin" 
        Add-PSSnapin "Microsoft.SharePoint.Powershell" 
    } 
    $dash = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;                                                                                                                                           
    $dash.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On;   //关闭时on改为Off                                                                                                                                     
    $dash.Update();                                                                                                                                                                                                                                                                    

    Write-Host "Sucess" ;   

  • 用 STSADM 

    stsadm -o setproperty -pn developer-dashboard -pv On  或者

    stsadm –o setproperty –pn developer-dashboard -pv  OnDemand. 

  • 选择OnDemand 会在页面的右上角出现一个小小的按钮来控制developer dashboard的显示与否。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值