none
Management Pack creation issue

    Question

  • Hello,

    I am running SCSM 2010 and I have a weird problem. I created a new incident view in the SCSM and saved it in a custom Management Pack. I then exported the Management Pack and added a <Resources></Resources> entry to it and change the <ImageReference> entry for that view. I have done this several times before for views in the default MPs and non-default MPs.

    But when I tried to create a MP bundle then I see the following error. I am using this New-MPBFile.ps1 powershell script. I got the script from here and it has worked before:
    http://blogs.technet.com/b/servicemanager/archive/2009/09/04/introducing-management-pack-bundles.aspx
    =============================================================================================
    VERBOSE: Adding MP: ManagementPack.e0b3753529ce4625bce1363ba57a74f6
    Exception calling "Write" with "2" argument(s): "SQL query syntax invalid or unsupported."
    At D:\adminroot\Management Packs\New-MPBFile.ps1:137 char:35
    + $mpbfullpath = $bundleWriter.Write <<<< ($BUNDLE,$mpbname)
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException

    VERBOSE: wrote mpb:
    =============================================================================================

    I triple checked the syntax and I am not able to find anything wrong. So I exported the MP again and tried to create a bundle out of the 'fresh' export MP and I see the same error.

    Can somebody please help and let me know what I am doing wrong or what the issue is?

    Thank you
    Mc2102

    Tuesday, January 31, 2012 4:58 PM

Answers

All replies

  • Hi,

    It's hard to say what's wrong when we don't have the MP, but you could try to see if it's related to your editing or not - export the fresh MP again and then bundle it, without editing it. If it works, you know that error is tied to one of your changes to the MP.

    Regards
    //Anders


    Anders Asp | Lumagate | www.lumagate.com | Sweden | My blog: www.scsm.se
    Tuesday, January 31, 2012 7:10 PM
    Moderator
  • Hello Anders,

     

    I already tried that and it throws the same error. The MP is further below. I guess the only other thing I could try is to drop the MP with the view in it and recreate it.

    =============================================================

    <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>ManagementPack.e0b3753529ce4625bce1363ba57a74f6</ID>
          <Version>7.0.6555.0</Version>
        </Identity>
        <Name>Incident Views Management Pack</Name>
        <References>
          <Reference Alias="EnterpriseManagement">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_WorkItem_Library">
            <ID>System.WorkItem.Library</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="EnterpriseManagement1">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Authoring</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="IncidentManagement">
            <ID>ServiceManager.IncidentManagement.Library</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_Library">
            <ID>System.Library</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="WorkItem">
            <ID>ServiceManager.WorkItem.Library</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_WorkItem_Incident_Library">
            <ID>System.WorkItem.Incident.Library</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
        </References>
      </Manifest>
      <Categories>
        <Category ID="Category.4b4037af49934eb99455bd4cb5b9ec99" Value="EnterpriseManagement!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
          <ManagementPackName>ManagementPack.e0b3753529ce4625bce1363ba57a74f6</ManagementPackName>
          <ManagementPackVersion>7.0.6555.0</ManagementPackVersion>
        </Category>
        <Category ID="Category.d5379b46c7824404a171ecff549f8926" Target="View.7e3d5955aa494a84a1037b13528fed5a" Value="EnterpriseManagement!Microsoft.EnterpriseManagement.ServiceManager.UI.Console.ViewTasks" />
        <Category ID="Category.88d2d6d44e674525bfd7df668347aedb" Target="View.7e3d5955aa494a84a1037b13528fed5a" Value="EnterpriseManagement1!Microsoft.EnterpriseManagement.ServiceManager.UI.Authoring.CreateTypeCategory" />
      </Categories>
      <Presentation>
        <Views>
          <View ID="View.7e3d5955aa494a84a1037b13528fed5a" Accessibility="Public" Enabled="true" Target="CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident" TypeID="EnterpriseManagement!GridViewType" Visible="true">
            <Category>NotUsed</Category>
            <Data>
              <Adapters>
                <Adapter AdapterName="dataportal:EnterpriseManagementObjectProjectionAdapter">
                  <AdapterAssembly>Microsoft.EnterpriseManagement.UI.SdkDataAccess</AdapterAssembly>
                  <AdapterType>Microsoft.EnterpriseManagement.UI.SdkDataAccess.DataAdapters.EnterpriseManagementObjectProjectionAdapter</AdapterType>
                </Adapter>
                <Adapter AdapterName="viewframework://Adapters/AdvancedList">
                  <AdapterAssembly>Microsoft.EnterpriseManagement.UI.ViewFramework</AdapterAssembly>
                  <AdapterType>Microsoft.EnterpriseManagement.UI.ViewFramework.AdvancedListSupportAdapter</AdapterType>
                </Adapter>
              </Adapters>
              <ItemsSource>
                <AdvancedListSupportClass DataTypeName="" AdapterName="viewframework://Adapters/AdvancedList" FullUpdateAdapter="dataportal:EnterpriseManagementObjectProjectionAdapter" DataSource="mom:ManagementGroup" FullUpdateFrequency="1" Streaming="true" IsRecurring="true" RecurrenceFrequency="{x:Static s:Int32.MaxValue}" xmlns="clr-namespace:Microsoft.EnterpriseManagement.UI.ViewFramework;assembly=Microsoft.EnterpriseManagement.UI.ViewFramework" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib">
                  <AdvancedListSupportClass.Parameters>
                    <QueryParameter Parameter="TypeProjectionId" Value="$MPElement[Name='IncidentManagement!System.WorkItem.Incident.ProjectionType']$" />
                  </AdvancedListSupportClass.Parameters>
                </AdvancedListSupportClass>
              </ItemsSource>
              <Criteria>
                <QueryCriteria Adapter="omsdk://Adapters/Criteria" xmlns="http://tempuri.org/Criteria.xsd">
                  <Criteria>
                    <FreeformCriteria>
                      <Freeform>
                        <Criteria xmlns="http://Microsoft.EnterpriseManagement.Core.Criteria/">
                          <Expression>
                            <And>
                              <Expression>
                                <SimpleExpression>
                                  <ValueExpressionLeft>
                                    <Property>$Context/Property[Type='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']/Source$</Property>
                                  </ValueExpressionLeft>
                                  <Operator>Equal</Operator>
                                  <ValueExpressionRight>
                                    <Value>{6ef191ce-3124-2974-94fb-020c677f4017}</Value>
                                  </ValueExpressionRight>
                                </SimpleExpression>
                              </Expression>
                              <Expression>
                                <SimpleExpression>
                                  <ValueExpressionLeft>
                                    <Property>$Context/Property[Type='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']/Status$</Property>
                                  </ValueExpressionLeft>
                                  <Operator>Equal</Operator>
                                  <ValueExpressionRight>
                                    <Value>{5e2d3932-ca6d-1515-7310-6f58584df73e}</Value>
                                  </ValueExpressionRight>
                                </SimpleExpression>
                              </Expression>
                              <Expression>
                                <UnaryExpression>
                                  <ValueExpression>
                                    <Property>$Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAssignedToUser' TypeConstraint='CustomSystem_Library!System.Domain.User']/Property[Type='CustomSystem_Library!System.Domain.User']/UserName$</Property>
                                  </ValueExpression>
                                  <Operator>IsNull</Operator>
                                </UnaryExpression>
                              </Expression>
                            </And>
                          </Expression>
                        </Criteria>
                      </Freeform>
                    </FreeformCriteria>
                  </Criteria>
                </QueryCriteria>
              </Criteria>
            </Data>
            <Presentation>
              <Columns>
                <mux:ColumnCollection xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mux="http://schemas.microsoft.com/SystemCenter/Common/UI/Views/GridView" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:data="clr-namespace:Microsoft.EnterpriseManagement.UI.SdkDataAccess.Common;assembly=Microsoft.EnterpriseManagement.UI.SdkDataAccess">
                  <mux:Column Name="Id" DisplayMemberBinding="{Binding Path=Id}" Width="100" DisplayName="Id.29272cc2b25b4afcb270ec3aebc99427" Property="Id" DataType="s:String" />
                  <mux:Column Name="Priority" DisplayMemberBinding="{Binding Path=Priority}" Width="100" DisplayName="Priority.2e06f8a061434d3b98450c77f2fa9044" Property="Priority" DataType="s:Int32" />
                  <mux:Column Name="Status.DisplayName" DisplayMemberBinding="{Binding Path=Status.DisplayName}" Width="100" DisplayName="Status.785d1d2254184bfebdfd268dc33d69c1" Property="Status.DisplayName" DataType="s:String" />
                  <mux:Column Name="TierQueue.DisplayName" DisplayMemberBinding="{Binding Path=TierQueue.DisplayName}" Width="100" DisplayName="TierQueue.8a9d79df258b4412bde9fc8b4dc2317b" Property="TierQueue.DisplayName" DataType="s:String" />
                  <mux:Column Name="Title" DisplayMemberBinding="{Binding Path=Title}" Width="100" DisplayName="Title.708ccbfda31b40dc9060ccd63aab7d26" Property="Title" DataType="s:String" />
                  <mux:Column Name="AffectedUser.DisplayName" DisplayMemberBinding="{Binding Path=AffectedUser.DisplayName}" Width="100" DisplayName="DisplayName.40ce556240ad4890b0ef1cfc007c84b0" Property="AffectedUser.DisplayName" DataType="s:String" />
                  <mux:Column Name="AssignedUser.DisplayName" DisplayMemberBinding="{Binding Path=AssignedUser.DisplayName}" Width="100" DisplayName="DisplayName.5369f2c392754e88b2f2f8c43b241d83" Property="AssignedUser.DisplayName" DataType="s:String" />
                </mux:ColumnCollection>
              </Columns>
              <ViewStrings>
                <ViewString ID="Id.29272cc2b25b4afcb270ec3aebc99427">$MPElement[Name="Id.29272cc2b25b4afcb270ec3aebc99427"]$</ViewString>
                <ViewString ID="Priority.2e06f8a061434d3b98450c77f2fa9044">$MPElement[Name="Priority.2e06f8a061434d3b98450c77f2fa9044"]$</ViewString>
                <ViewString ID="Status.785d1d2254184bfebdfd268dc33d69c1">$MPElement[Name="Status.785d1d2254184bfebdfd268dc33d69c1"]$</ViewString>
                <ViewString ID="TierQueue.8a9d79df258b4412bde9fc8b4dc2317b">$MPElement[Name="TierQueue.8a9d79df258b4412bde9fc8b4dc2317b"]$</ViewString>
                <ViewString ID="Title.708ccbfda31b40dc9060ccd63aab7d26">$MPElement[Name="Title.708ccbfda31b40dc9060ccd63aab7d26"]$</ViewString>
                <ViewString ID="DisplayName.40ce556240ad4890b0ef1cfc007c84b0">$MPElement[Name="DisplayName.40ce556240ad4890b0ef1cfc007c84b0"]$</ViewString>
                <ViewString ID="DisplayName.5369f2c392754e88b2f2f8c43b241d83">$MPElement[Name="DisplayName.5369f2c392754e88b2f2f8c43b241d83"]$</ViewString>
              </ViewStrings>
            </Presentation>
          </View>
        </Views>
        <FolderItems>
          <FolderItem ElementID="View.7e3d5955aa494a84a1037b13528fed5a" ID="FolderItem.7827dba9219949cf8759d22ee706d469" Folder="IncidentManagement!ServiceManager.Console.IncidentManagement" />
        </FolderItems>
        <ImageReferences>
          <ImageReference ElementID="View.7e3d5955aa494a84a1037b13528fed5a" ImageID="AllNewPortalIncidents16x16" />
        </ImageReferences>
        <StringResources>
          <StringResource ID="Description.a9e6613f329e4014b456a5c9d2ccb0f5" />
          <StringResource ID="DisplayName.465630868a83424ea3fb27f7270bf8c1" />
          <StringResource ID="DisplayName.38773d1bc9a544d098116d63bc3d322e" />
          <StringResource ID="Id.29272cc2b25b4afcb270ec3aebc99427" />
          <StringResource ID="Priority.2e06f8a061434d3b98450c77f2fa9044" />
          <StringResource ID="Status.785d1d2254184bfebdfd268dc33d69c1" />
          <StringResource ID="TierQueue.8a9d79df258b4412bde9fc8b4dc2317b" />
          <StringResource ID="Title.708ccbfda31b40dc9060ccd63aab7d26" />
          <StringResource ID="DisplayName.40ce556240ad4890b0ef1cfc007c84b0" />
          <StringResource ID="DisplayName.5369f2c392754e88b2f2f8c43b241d83" />
        </StringResources>
      </Presentation>
      <LanguagePacks>
        <LanguagePack ID="ENU" IsDefault="true">
          <DisplayStrings>
            <DisplayString ElementID="ManagementPack.e0b3753529ce4625bce1363ba57a74f6">
              <Name>Incident Views Management Pack</Name>
              <Description></Description>
            </DisplayString>
            <DisplayString ElementID="View.7e3d5955aa494a84a1037b13528fed5a">
              <Name>All New Portal Incidents</Name>
              <Description>This view contains all new incidents created by end users</Description>
            </DisplayString>
            <DisplayString ElementID="Description.a9e6613f329e4014b456a5c9d2ccb0f5">
              <Name>Description</Name>
              <Description>Description</Description>
            </DisplayString>
            <DisplayString ElementID="DisplayName.465630868a83424ea3fb27f7270bf8c1">
              <Name>Display Name</Name>
              <Description>Display name of the object.</Description>
            </DisplayString>
            <DisplayString ElementID="DisplayName.38773d1bc9a544d098116d63bc3d322e">
              <Name>Display Name</Name>
              <Description>Display name</Description>
            </DisplayString>
            <DisplayString ElementID="Id.29272cc2b25b4afcb270ec3aebc99427">
              <Name>ID</Name>
              <Description>Work item ID</Description>
            </DisplayString>
            <DisplayString ElementID="Priority.2e06f8a061434d3b98450c77f2fa9044">
              <Name>Priority</Name>
              <Description>Priority</Description>
            </DisplayString>
            <DisplayString ElementID="Status.785d1d2254184bfebdfd268dc33d69c1">
              <Name>Status</Name>
              <Description>Status</Description>
            </DisplayString>
            <DisplayString ElementID="TierQueue.8a9d79df258b4412bde9fc8b4dc2317b">
              <Name>Support group</Name>
              <Description>Support group</Description>
            </DisplayString>
            <DisplayString ElementID="Title.708ccbfda31b40dc9060ccd63aab7d26">
              <Name>Title</Name>
              <Description>Title</Description>
            </DisplayString>
            <DisplayString ElementID="DisplayName.40ce556240ad4890b0ef1cfc007c84b0">
              <Name>Display Name</Name>
              <Description>Display name of the object.</Description>
            </DisplayString>
            <DisplayString ElementID="DisplayName.5369f2c392754e88b2f2f8c43b241d83">
              <Name>Display Name</Name>
              <Description>Display name of the object.</Description>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
      </LanguagePacks>
      <Resources>
        <Image ID="AllNewPortalIncidents16x16" Accessibility="Public" FileName="AllNewPortalIncidents16x16.png" HasNullStream="false" />
      </Resources>
    </ManagementPack>

    Tuesday, January 31, 2012 7:29 PM
  • I deleted the MP and started from scratch
    • Marked as answer by Mc2102 Thursday, March 15, 2012 9:18 PM
    Thursday, March 15, 2012 9:18 PM
  • did you find a solution to this problem?

    Saturday, March 24, 2012 7:44 PM
  • The <Resources> will work only for Schema version 2.0

    The following page lists that we can mention images, assembly (dlls.. etc.) as the resources. 

    http://msdn.microsoft.com/en-us/library/hh362379.aspx

    Adding Image in the Resources worked fine and I was able to create a management pack bundle of it. But, When trying to add the <Assembly> directive - I got an error - "XSD verification failed at line [xx". Thought the documentation suggests that this should be working - it doesn't seem to work for me as of now. 

    Has somebody had any luck packaging assemblies?

    Sunday, March 25, 2012 8:42 PM
  • Make sure you put "Assembly" before "Image" like this:

    <Resources>
    
        <Assembly ID="YourAssemblyID" Accessibility="Public" FileName="Your.dll" HasNullStream="false" QualifiedName="Your"/>
        
       <Image ID="Icon.16x16" Accessibility="Public" FileName="Icon.16x16.ico" />
      
    </Resources>

    Sunday, March 25, 2012 10:29 PM
    Moderator