次の方法で共有


How to Reference Existing Management Packs

Applies To: System Center 2012 - Service Manager

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Management packs that you create will always reference other management packs. When you build or extend a management pack by using code, the process automatically defines the management pack’s references to other management packs. Whenever you use a type that is provided by another management pack, the SDK automatically creates a reference to access the type in the other management pack. If you manually build a management pack by using XML and then import it, you must also manually add the references.

Every reference to another management must contain three key pieces of information about the other management pack. The following table describes the required information.

Required Information Description

ID

The identifier (text, not GUID) of the management pack.

Version

Version of the management pack.

PublicKeyToken

The public key of the management pack.

The process assigns an alias identifier to each reference. The single-word alias makes it easier to reference management packs that have long identifiers.

Example

The following example shows how to create a reference to the System.WorkItem.Library management pack. The management pack creates a new class named RePackaging.Request and uses the referenced management pack’s System.WorkItem class as the base class.

<ManagementPack ContentReadable="true" SchemaVersion="1.1" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <Manifest>
    <Identity>
      <ID>RePackaging.Library</ID>
      <Version>1.0.0.6</Version>
    </Identity>
    <Name>RePackaging Library</Name>
    <References>
      <Reference Alias="WorkItem">
        <ID>System.WorkItem.Library</ID>
        <Version>7.0.5805.0</Version>
        <PublicKeyToken>9396306c2be7fcc4</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="RePackaging.Request" Accessibility="Public" Abstract="false" Base="WorkItem!System.WorkItem" Hosted="false" Singleton="false" Extension="false" />
      </ClassTypes>
    </EntityTypes>
  </TypeDefinitions>
</ManagementPack>

See Also

Tasks

How to Uninstall a Management Pack

Other Resources

Scenario: Managing Management Packs