識別提供者

資訊清單可以識別一或多個提供者。 若要識別提供者,請使用 provider 元素。 您必須指定 名稱guidresourceFileNamemessageFileName符號 屬性。 如果您當地語系化資訊清單,您也應該指定 訊息 屬性,取用者會用來作為提供者的名稱。 如果您未指定 訊息 屬性,取用者會使用 name 屬性的值。

您可以在資訊清單中識別最多 16 個提供者。 如果您想要識別超過 16 個提供者,您必須包含資訊清單的 messageTable 區段,而提供者必須用來為其定義的訊息字串指派資源值,訊息表不得包含提供者 1 到 16 定義的任何訊息字串。

下列範例示範如何使用 提供者 專案來識別提供者。

<instrumentationManifest
    xmlns="http://schemas.microsoft.com/win/2004/08/events" 
    xmlns:win="http://manifests.microsoft.com/win/2004/08/windows/events"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    >

    <instrumentation>
        <events>
            <provider name="Microsoft-Windows-SampleProvider" 
                guid="{1db28f2e-8f80-4027-8c5a-a11f7f10f62d}" 
                symbol="PROVIDER_GUID" 
                resourceFileName="<path to the exe or dll that contains the metadata resources>" 
                messageFileName="<path to the exe or dll that contains the string resources>"
                message="$(string.Provider.Name)">

                . . .

            </provider>
        </events>
    </instrumentation>

    <localization>
        <resources culture="en-US">
            <stringTable>
                <string id="Provider.Name" value="Microsoft-Windows-SampleProvider"/>
            </stringTable>
        </resources>
    </localization>

</instrumentationManifest>