locked
Error importing MP after Sealing . RRS feed

  • Question

  • Hi

    I made a custom MP that I need to seal, after sealing it I can not import it. I made a simple MP with the same behavior.

    I created a new MP from Auth console , created a CI class added 1 property string, added 1 Form.

    If I don't seal the MP I can import it without errors, but if I seal the MP I get the  error below.

    Any ideas, I maybe missing som basics ..

    System.ArgumentException: The requested management pack is not valid. See inner exception for details.
    Parameter name: managementPack ---> : Verification failed with 1 errors:
    -------------------------------------------------------
    Error 1:
    : The Target attribute value is not valid. Element Seal_test.Category references a Target element that cannot be found.

    -------------------------------------------------------

    The Target attribute value is not valid. Element Seal_test.Category references a Target element that cannot be found.
       --- End of inner exception stack trace ---
       at Microsoft.EnterpriseManagement.ManagementPackManagement.ImportManagementPack(ManagementPack managementPack, IDictionary`2 resources)
       at Microsoft.EnterpriseManagement.UI.SdkDataAccess.DataAdapters.ManagementPackWriteAdapter.WriteSdkObject(EnterpriseManagementGroup managementGroup, ManagementPack sdkObject, IDictionary`2 parameters)
       at Microsoft.EnterpriseManagement.UI.SdkDataAccess.DataAdapters.SdkWriteAdapter`1.WriteSdkObject(EnterpriseManagementGroup managementGroup, IList`1 sdkObjects, IDictionary`2 parameters)
       at Microsoft.EnterpriseManagement.UI.SdkDataAccess.DataAdapters.SdkWriteAdapter`1.DoAction(DataQueryBase query, IList`1 dataSources, IDictionary`2 parameters, IList`1 inputs, String outputCollectionName)
       at Microsoft.EnterpriseManagement.UI.DataModel.QueryQueue.StartExecuteQuery(Object sender, ConsoleJobEventArgs e)
       at Microsoft.EnterpriseManagement.ServiceManager.UI.Console.ConsoleJobExceptionHandler.ExecuteJob(IComponent component, EventHandler`1 job, Object sender, ConsoleJobEventArgs args)


    /Micke
    Thursday, November 25, 2010 8:43 AM

Answers

  • You must add ManagementPackPublicKeyToken to category after sealing. Change to:

    <Category ID="Seal_test.Category" Value="Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
      <ManagementPackName>Seal_test</ManagementPackName>
      <ManagementPackVersion>1.0.0.0</ManagementPackVersion>
      <ManagementPackPublicKeyToken>%YOURTOKEN%</ManagementPackPublicKeyToken>
    </Category>
    
    
    
    Replace %YOURTOKEN% to your real token (look like '31bf3856ad364e35')
    http://opsmgr.ru
    Monday, November 29, 2010 10:44 AM

All replies

  • Here is the Xml for the simple MP test

    <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>Seal_test</ID>

    <Version>1.0.0.0</Version>

    </Identity>

    <Name>Seal_test</Name>

    <References>

    <Reference Alias="System">

    <ID>System.Library</ID>

    <Version>7.0.5826.0</Version>

    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

    </Reference>

    <Reference Alias="Console">

    <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>

    <Version>7.0.5826.886</Version>

    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

    </Reference>

    <Reference Alias="Alias_84f4350a_5ef0_4158_a0fa_37a12b85b3b1">

    <ID>Microsoft.EnterpriseManagement.ServiceManager.Authoring.Forms</ID>

    <Version>7.0.5826.886</Version>

    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

    </Reference>

    </References>

    </Manifest>

    <TypeDefinitions>

    <EntityTypes>

    <ClassTypes>

    <ClassType ID="Seal_Test_Class" Accessibility="Public" Abstract="false" Base="System!System.ConfigItem" Hosted="false" Singleton="false" Extension="false">

    <Property ID="Property_4" Type="string" AutoIncrement="false" Key="true" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" />

    </ClassType>

    </ClassTypes>

    </EntityTypes>

    </TypeDefinitions>

    <Categories>

    <Category ID="Seal_test.Category" Value="Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">

    <ManagementPackName>Seal_test</ManagementPackName>

    <ManagementPackVersion>1.0.0.0</ManagementPackVersion>

    </Category>

    </Categories>

    <Presentation>

    <Forms>

    <Form ID="Seal_Test_form" Accessibility="Public" Target="Seal_Test_Class" Assembly="Alias_84f4350a_5ef0_4158_a0fa_37a12b85b3b1!AuthoringFormsAssembly" TypeName="Microsoft.EnterpriseManagement.ServiceManager.Authoring.Forms.EmptyForm">

    <Category>Form</Category>

    <Customization>

    <AddControl Parent="Grid_1" Assembly="PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Type="System.Windows.Controls.Label" Left="122.5" Top="171" Right="397" Bottom="606" Row="0" Column="0" />

    <PropertyChange Object="Label_1" Property="HorizontalAlignment">

    <NewValue>Left</NewValue>

    </PropertyChange>

    <PropertyChange Object="Label_1" Property="Margin">

    <NewValue>122.5,171,0,606</NewValue>

    </PropertyChange>

    <PropertyChange Object="Label_1" Property="VerticalAlignment">

    <NewValue>Top</NewValue>

    </PropertyChange>

    <PropertyChange Object="Label_1" Property="Margin">

    <NewValue>122.5,171,0,0</NewValue>

    </PropertyChange>

    <PropertyBindingChange Object="Label_1" Property="Content">

    <NewBinding Enabled="False" />

    </PropertyBindingChange>

    <PropertyChange Object="Label_1" Property="Content">

    <NewValue>Device</NewValue>

    </PropertyChange>

    <AddControl Parent="Grid_1" Assembly="PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Type="System.Windows.Controls.TextBox" Left="277.5" Top="190" Right="242" Bottom="587" Row="0" Column="0" />

    <PropertyChange Object="TextBox_1" Property="Width">

    <NewValue>Auto</NewValue>

    </PropertyChange>

    <PropertyChange Object="TextBox_1" Property="VerticalAlignment">

    <NewValue>Top</NewValue>

    </PropertyChange>

    <PropertyChange Object="TextBox_1" Property="Margin">

    <NewValue>277.5,190,242,0</NewValue>

    </PropertyChange>

    <Move X="61" Y="19">

    <Element Name="TextBox_1" />

    </Move>

    <PropertyChange Object="TextBox_1" Property="Margin">

    <NewValue>216.5,171,303,606</NewValue>

    </PropertyChange>

    <PropertyChange Object="TextBox_1" Property="HorizontalAlignment">

    <NewValue>Left</NewValue>

    </PropertyChange>

    <PropertyChange Object="TextBox_1" Property="Margin">

    <NewValue>216.5,171,0,606</NewValue>

    </PropertyChange>

    <PropertyChange Object="TextBox_1" Property="Width">

    <NewValue>80.5</NewValue>

    </PropertyChange>

    <PropertyChange Object="TextBox_1" Property="Margin">

    <NewValue>216.5,171,0,0</NewValue>

    </PropertyChange>

    <PropertyChange Object="TextBox_1" Property="Text">

    <NewValue></NewValue>

    </PropertyChange>

    <PropertyBindingChange Object="TextBox_1" Property="Text">

    <NewBinding Enabled="True" Path="Property_4" Mode="Default" BindsDirectlyToSource="False" UpdateSourceTrigger="Default" />

    </PropertyBindingChange>

    </Customization>

    </Form>

    </Forms>

    </Presentation>

    <LanguagePacks>

    <LanguagePack ID="ENU" IsDefault="true">

    <DisplayStrings>

    <DisplayString ElementID="Seal_test">

    <Name>Seal_test</Name>

    </DisplayString>

    <DisplayString ElementID="Seal_Test_Class">

    <Name>Seal_Test_Class</Name>

    <Description>Specify your class description.</Description>

    </DisplayString>

    <DisplayString ElementID="Seal_Test_Class" SubElementID="Property_4">

    <Name>Device</Name>

    </DisplayString>

    <DisplayString ElementID="Seal_Test_form">

    <Name>Seal_Test_form</Name>

    <Description>Specify your form description.</Description>

    </DisplayString>

    </DisplayStrings>

    </LanguagePack>

    </LanguagePacks>

    </ManagementPack>


    /Micke
    Thursday, November 25, 2010 8:57 AM
  • You must add ManagementPackPublicKeyToken to category after sealing. Change to:

    <Category ID="Seal_test.Category" Value="Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
      <ManagementPackName>Seal_test</ManagementPackName>
      <ManagementPackVersion>1.0.0.0</ManagementPackVersion>
      <ManagementPackPublicKeyToken>%YOURTOKEN%</ManagementPackPublicKeyToken>
    </Category>
    
    
    
    Replace %YOURTOKEN% to your real token (look like '31bf3856ad364e35')
    http://opsmgr.ru
    Monday, November 29, 2010 10:44 AM
  • I  was just o my way to write that the case was solved, found out that you now can seal the MP from the Auth console..., doing so worked, before I tried from a commandprompt using fastseal.exe.

     

    Perhaps the Authconsole does add the publickeytoken element, that I missed

     

     

    Thanks for the replay any way :-)

     

     


    /Micke
    Monday, November 29, 2010 12:03 PM