共用方式為


Utility.LogCustomRemoteAppError 方法

從遠端元件的雲端裝載SharePoint Add-ins自訂錯誤的報表。

命名空間:  Microsoft.SharePoint.Client.Utilities
組件:   Microsoft.SharePoint.Client.Silverlight (在 Microsoft.SharePoint.Client.Silverlight.dll 中);  Microsoft.SharePoint.Client.Phone (在 Microsoft.SharePoint.Client.Phone.dll 中)  Microsoft.SharePoint.Client (在 Microsoft.SharePoint.Client.dll 中)

語法

'宣告
Public Shared Function LogCustomRemoteAppError ( _
    context As ClientRuntimeContext, _
    productId As Guid, _
    error As String _
) As ClientResult(Of LogAppErrorResult)
'用途
Dim context As ClientRuntimeContext
Dim productId As Guid
Dim error As String
Dim returnValue As ClientResult(Of LogAppErrorResult)

returnValue = Utility.LogCustomRemoteAppError(context, _
    productId, error)
public static ClientResult<LogAppErrorResult> LogCustomRemoteAppError(
    ClientRuntimeContext context,
    Guid productId,
    string error
)

參數

  • productId
    類型:System.Guid

    SharePoint Add-in 產品識別碼。

傳回值

類型:Microsoft.SharePoint.Client.ClientResult<LogAppErrorResult>
指定是否記錄嘗試成功的值。

備註

productId必須ProductID屬性App element (SharePoint App Manifest)應用程式資訊清單中的相同。由於呼叫LogCustomRemoteAppError(ClientRuntimeContext, Guid, String)的 web 應用程式沒有在執行階段取得這項資訊安全簡單的方法,您應該在 web 應用程式中儲存此值。請考慮使用這項目的 Global.asax 檔案以及 Global.asax.cs (或 Global.asax.vb) 檔案。定義的類型Guidpublicstatic欄位中的檔案後的程式碼的Global類別。將其指派的產品識別碼從應用程式資訊清單 (包括 「 {」 符號和連字號) 如下列範例所示 ︰

Public static Guid productID = new Guid("{2ED827F8-5736-4792-B287-A27F64F1D09D}");

然後傳遞Global.productIDproductId參數。

請參閱

參照

Utility 類別

Utility 成員

Microsoft.SharePoint.Client.Utilities 命名空間