<customErrorReporting>項目 (ClickOnce 部署)<customErrorReporting> element (ClickOnce deployment)

指定要在錯誤發生時顯示的 URI。Specifies a URI to show when an error occurs.

語法Syntax

<customErrorReporting
   uri
/>

備註Remarks

這是選擇性的項目。This element is optional. 否則,ClickOnceClickOnce會顯示錯誤對話方塊顯示的例外狀況堆疊。Without it, ClickOnceClickOnce displays an error dialog box showing the exception stack. 如果customErrorReporting項目,則ClickOnceClickOnce改為將會顯示所指定的 URIuri參數。If the customErrorReporting element is present, ClickOnceClickOnce will instead display the URI indicated by the uri parameter. 目標 URI 會包含外部例外狀況類別、 內部例外狀況類別,以及內部例外狀況訊息,做為參數。The target URI will include the outer exception class, the inner exception class, and the inner exception message as parameters.

您可以使用此項目新增至您的應用程式報告功能的錯誤。Use this element to add error reporting functionality to your application. 因為產生的 URI 包含錯誤的類型的相關資訊,該資訊,並顯示,例如,適當的疑難排解畫面內可剖析您的網站。Since the generated URI includes information about the type of error, your Web site can parse that information and display, for example, an appropriate troubleshooting screen.

範例Example

下列程式碼片段顯示customErrorReporting項目,以及它可能會產生所產生的 URI。The following snippet shows the customErrorReporting element, together with the generated URI it might produce.

<customErrorReporting uri=http://www.contoso.com/applications/error.asp />

Example Generated Error:
http://www.contoso.com/applications/error.asp? outer=System.Deployment.Application.InvalidDeploymentException&&inner=System.Deployment.Application.InvalidDeploymentException&&msg=The%20application%20manifest%20is%20signed,%20but%20the%20deployment%20manifest%20is%20unsigned.%20Both%20manifests%20must%20be%20either%20signed%20or%20unsigned.

另請參閱See also