徵兆

請試想下列案例:

您嘗試在 SharePoint 2010 中啟動沙箱化程式代碼服務。  與服務相關聯的處理程式會顯示為提供給使用者,但會立即消失。 SharePoint ULS 記錄檔顯示下列錯誤:

「處理 perf 計數器已停用。 沙箱化程式代碼監控無法繼續。'

原因

當登錄機碼 『HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance\Disable Performance Counters』 值設為 1 時,就會發生此問題。

解決方案

若要修正此問題,您必須修改登錄。 

重要:本章節、方法或工作包含修改登錄的步驟。 然而,不當修改登錄可能會發生嚴重的問題。 因此,請務必謹慎地依照這些步驟執行。 為加強保護,請先備份登錄再進行修改。 這樣一來,如果發生問題,您就可以還原登錄。 如需有關如何備份和還原登錄的詳細資訊,請按下列文件編號,檢視「Microsoft 知識庫」中的文章:

322756 - 如何在 Windows 中備份及還原登錄

若要修正問題並順利執行沙盒化程式代碼服務,使用者應刪除登錄機碼或將值設為 『0』。 如果要執行這項操作,請依照下列步驟執行:

  1. 按兩下 [開始],在 [開始搜尋] 方塊中輸入 regedit ,然後按 ENTER

  2. 找出並按下列登入子機碼:      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance\Disable Performance Counters

  3. 在 [編輯] 功能表上,按兩下 [ 修改]

  4. 在 [ 值數據 ] 方塊中,將值變更為 [0],然後按兩下 [ 確定]

  5. 結束 [登錄編輯程式]。

其他相關資訊

在 SharePoint ULS 記錄檔中,您可能會看到下列錯誤:

SPUCHostService.exe (0x17C0) 0x172C SharePoint Foundation Sandboxed Code Service ei19 詳細資訊- 嘗試初始化 SPUserCodeHostService 時,發現未處理的例外狀況。 此服務現在將會終止。 PID = 6080。 Exception = System.ComponentModel.Win32Exception: unknown error (0xc0000bbc) at Microsoft.SharePoint.Win32.SPPdh.CheckReturnValue (PDH_STATUS 狀態, 布爾) 值會在 Microsoft.SharePoint.Utilities.SPPerformanceCounter.NextValue (Int32 retry, Int32 retryInterval) at Microsoft.SharePoint.UserCode.SPUserCodePerformanceCounterHelper.ctor (String processName, Int32 processInstanceId) at Microsoft.SharePoint.UserCode.SPUserCodeProcessMonitor.EnsurePerfCounters (IMonitorableProcess monitorableProcess, Int32& indexShimInstance, Int32& indexProxyInstance) at Microsoft.SharePoint.UserCode.SPUserCodeProcessMonitor.CreateMonitoredProcess (IMonitorableProcess monitorableProcess) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcessPool.AddProcess (ISPUserCodePoolableProcessprocess) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcessPool.StartProcessInternal () at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcessPool.StartProcess () at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcessPool.Initialize (String 實例) at Microsoft.SharePoint.UserCode.SPUserCodeExecutionHost.InitializeInternal (ISPUserCodePoolableProcessFactory processFactory) at Microsoft.SharePoint.UserCode.SPUserCodeExecutionHostService.InitializeThreadProc (Object stateInfo)

SPUCHostService.exe (0x099C) 0x0A1C SharePoint Foundation General 84yj Medium Performance Counter OS (pdh) 通話失敗,PDH_INVALID_HANDLE錯誤碼。

SPUCHostService.exe (0x099C) 0x0A1C SharePoint Foundation 使用者代碼服務 ela0 詳細資訊 - 讀取 perf 計數器 IO 數據位元組/秒失敗,但 System.ComponentModel.Win32Exception 例外:Microsoft.SharePoint.Win32.SPPdh.CheckReturnValue (PDH_STATUS 狀態發生未知的錯誤 (0xc0000bbc) , 布爾) 值在 Microsoft.SharePoint.Utilities.SPPerformanceCounter.NextValue (Int32 重試,Int32 retryInterval) at Microsoft.SharePoint.UserCode.PerfCounterData.Update () ,請重複使用最後值 0。

SPUCHostService.exe (0x099C) 0x0A1C SharePoint Foundation User Code Service ei0r 詳細資訊 - 監控處理程式 “SPUCWorkerProcess” 的已讀取 perf 計數器:PercentProcessorTime=0 ProcessVirtualBytes=0 ProcessHandleCount=0 ProcessThreadCount=0 ProcessIOBytes=0

SPUCHostService.exe (0x099C) 0x0A1C SharePoint Foundation General 84yj MediumPerformance Counter OS (pdh) 通話失敗,PDH_INVALID_HANDLE錯誤碼。

SPUCHostService.exe (0x099C) 0x0A1C SharePoint Foundation User Code Service ela0 詳細資訊- 讀取 perf 計數計數失敗,例外 System.ComponentModel.Win32Exception:在 Microsoft.SharePoint.Win32.SPPdh.CheckReturnValue (PDH_STATUS 狀態發生未知的錯誤 (0xc0000bbc) , 布爾) 值在 Microsoft.SharePoint.Utilities.SPPerformanceCounter.NextValue (Int32 重試,Int32 retryInterval) at Microsoft.SharePoint.UserCode.PerfCounterData.Update () , 重複使用最後值 0。 

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。