次の方法で共有


custom attributes are not displayed correctly, the displayed string is a GUID

Hi all,

I encountered this odd issue, which seems to be environment specific: custom attributes are not displayed correctly, the display string is a GUID. This does not happen for the first custom attribute, only after the second one is created. 

When viewing the XML of the Management Pack where it is stored, we see for the different language definitions , different IDs. That means one of them is wrong

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

      <DisplayStrings>

        <DisplayString ElementID="MG.System.Classification">

          <Name>MG System Classification</Name>

          <Description></Description>

        </DisplayString>

        <DisplayString ElementID="Folder_5339be059f5f41dc8ddf9e51a1b13a65">

          <Name>MG System Classification</Name>

        </DisplayString>

        <DisplayString ElementID="AttributeDiscoveryGeneratedByUI665c85472808495f872183ba1024ea9f">

          <Name>Custom Attribute 1</Name>

        </DisplayString>

        <DisplayString ElementID="Typef7c2310efbfe4afd8031e75da94b548f">

          <Name>Windows Computer_Extended</Name>

        </DisplayString>

        <DisplayString ElementID="Typef7c2310efbfe4afd8031e75da94b548f" SubElementID="AttributeDiscoveryGeneratedByUIb6aaec92b28c4bd788528c8d940d6d87">

          <Name>Custom Attribute 2</Name>

          <Description></Description>

        </DisplayString>

        <DisplayString ElementID="AttributeDiscoveryGeneratedByUIf86c5bfcd8144d5391e237747f2fc43b">

          <Name>Custom Attribute 3</Name>

 

<LanguagePack ID="DES" IsDefault="false">

      <DisplayStrings>

        <DisplayString ElementID="Typef7c2310efbfe4afd8031e75da94b548f" SubElementID="AttributeDiscoveryGeneratedByUIb6aaec92b28c4bd788528c8d940d6d87">

          <Name>Custom Attribute 1</Name>

          <Description></Description>

        </DisplayString>

        <DisplayString ElementID="Typef7c2310efbfe4afd8031e75da94b548f" SubElementID="AttributeDiscoveryGeneratedByUI512626e82d3344d4bd58537387a0acc7">

          <Name>Custom Attribute 2</Name>

          <Description></Description>

        </DisplayString>

 

Correct:

 

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

      <DisplayStrings>

        <DisplayString ElementID="MG.SystemClassification">

          <Name>MG SystemClassification</Name>

          <Description>Management Pack Description</Description>

        </DisplayString>

        <DisplayString ElementID="Folder_5339be059f5f41dc8ddf9e51a1b13a65">

          <Name>MG SystemClassification</Name>

        </DisplayString>

        <DisplayString ElementID="AttributeDiscoveryGeneratedByUI665c85472808495f872183ba1024ea9f">

          <Name>Custom Attribute 1</Name>

        </DisplayString>

        <DisplayString ElementID="Typef7c2310efbfe4afd8031e75da94b548f">

          <Name>Windows Computer_Extended</Name>

        </DisplayString>

        <DisplayString ElementID="Typef7c2310efbfe4afd8031e75da94b548f" SubElementID="AttributeDiscoveryGeneratedByUIb6aaec92b28c4bd788528c8d940d6d87">

          <Name>Custom Attribute 2</Name>

          <Description></Description>

        </DisplayString>

 

<DisplayString ElementID="Typef7c2310efbfe4afd8031e75da94b548f" SubElementID="AttributeDiscoveryGeneratedByUI512626e82d3344d4bd58537387a0acc7">

          <Name>Custom Attribute 3</Name>

          <Description></Description>

        </DisplayString>

 

 

<LanguagePack ID="DES" IsDefault="false">

      <DisplayStrings>

      

        <DisplayString ElementID="Typef7c2310efbfe4afd8031e75da94b548f" SubElementID="AttributeDiscoveryGeneratedByUI512626e82d3344d4bd58537387a0acc7">

          <Name>Custom Attribute 1</Name>

          <Description></Description>

        </DisplayString>

 

<DisplayString ElementID="Typef7c2310efbfe4afd8031e75da94b548f" SubElementID="AttributeDiscoveryGeneratedByUIb6aaec92b28c4bd788528c8d940d6d87">

          <Name>Custom Attribute 2</Name>

          <Description></Description>

        </DisplayString>

 

      </DisplayStrings>

    </LanguagePack>

 

So basically, you`ll have to double check the SubElementID for the attribute and take the correct one from the other language definition, from the same MP. This way, the element will be mapped correctly and therefore displayed.