Management Pack Help
Dear All,
When trying to edit a clean management pack in Service Manager Authoring Tool i get the following error. Can you help please?
Thanks
Daniel
Verification failed with 1 errors:
-------------------------------------------------------
Error 1:
Found error in 2|UnknowMP|1.0.0.0|UnknowMP|| with message:
XSD verification failed for the management pack. [Line: 0, Position: 0]
System.Xml.Schema.XmlSchemaValidationException: 'test1' is already used as an ID.
at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity)
at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(String code, String arg)
at System.Xml.Schema.XmlSchemaValidator.ProcessTokenizedType(XmlTokenizedType ttype, String name, Boolean attrValue)
at System.Xml.Schema.XmlSchemaValidator.CheckTokenizedTypes(XmlSchemaDatatype dtype, Object typedValue, Boolean attrValue)
at System.Xml.Schema.XmlSchemaValidator.ValidateAttribute(String lName, String ns, XmlValueGetter attributeValueGetter, String attributeStringValue, XmlSchemaInfo schemaInfo)
at System.Xml.Schema.XmlSchemaValidator.ValidateAttribute(String localName, String namespaceUri, XmlValueGetter attributeValue, XmlSchemaInfo schemaInfo)
at System.Xml.XsdValidatingReader.ValidateAttributes()
at System.Xml.XsdValidatingReader.ProcessElementEvent()
at System.Xml.XsdValidatingReader.ProcessReaderEvent()
at System.Xml.XsdValidatingReader.Read()
at Microsoft.EnterpriseManagement.Configuration.XSDVerification.ValidateManagementPack(TextReader mpcontents, ManagementPack mp, Boolean throwError)
-------------------------------------------------------
XSD verification failed for the management pack. [Line: 0, Position: 0]
Answers
I've fixed the issue now.
I was receiving this in the SCSM SDK, when attempting to create a new template, but assigning the template identifier as the same name as the management pack ID.
//incorrect version
EnterpriseManagementGroup emg = new EnterpriseManagementGroup("localhost");
var thisUnsealedMP = emg.ManagementPacks.GetManagementPack("260e3262-4bbd-5d64-a3f9-0dd102a4a60d"); //unsealed MP guid in my environment.
mpotThisTemplate = new ManagementPackObjectTemplate(thisUnsealedMP, thisUnsealedMP.Name); //I'm bad :(
mpotThisTemplate.TypeID = mpcSystemNotificationTemplateSMTP;
thisUnsealedMP.AcceptChanges(ManagementPackVerificationTypes.FullVerification); //I fail here with a XmlSchemaValidationException, mpinternalName is already used as an ID.
//correct version
EnterpriseManagementGroup emg = new EnterpriseManagementGroup("localhost");
var thisUnsealedMP = emg.ManagementPacks.GetManagementPack("260e3262-4bbd-5d64-a3f9-0dd102a4a60d"); //unsealed MP guid in my environment.
String templateTempId = ("Template." + Guid.NewGuid()).Replace("-", "");
mpotThisTemplate = new ManagementPackObjectTemplate(thisUnsealedMP, templateTempId);
mpotThisTemplate.TypeID = mpcSystemNotificationTemplateSMTP;
thisUnsealedMP.AcceptChanges(ManagementPackVerificationTypes.FullVerification); //I now work, since the template ID is now different than the MP Id.