none
Template fails to upload to TFS 2012

    Question

  • I exported the Microsoft Scrum 2.0 template in TFS 2012 and then deleted and tried to re-upload it with "No Changes!"  I get this error:

    2012-11-14T15:30:41 | Module: Work Item Tracking | Thread: 20 | Validating categories from file 'C:\source\TFS Process Templates\Microsoft Visual Studio Scrum 2.0\WorkItem Tracking\Categories.xml'...

    ---begin Exception entry---
    Time: 2012-11-14T15:30:42
    Module: Work Item Tracking
    Exception Message: The element 'CATEGORY' has invalid child element 'DEFAULTWORKITEMTYPE'. List of possible elements expected: 'WORKITEMTYPE'. (type XmlSchemaValidationException)
    Exception Stack Trace:  
    --- end Exception entry ---

    ---begin Exception entry---
    Time: 2012-11-14T15:30:42
    Module: Engine
    Event Description: TF30162: Task "Categories" from Group "WorkItemTracking" failed
    Exception Type: Microsoft.TeamFoundation.Client.PcwException
    Exception Message: TF237070: Importing the definition failed. The definition you are trying to import did not validate against the schema. Edit the definition, then try to import it again.
    Stack Trace:
       at Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.WitPcwPlugin.PcwPluginComponentCreator.Validate(ProjectCreationContext ctxt, XmlNode taskXml)
       at Microsoft.VisualStudio.TeamFoundation.PCW.ProjectCreationEngine.TaskValidator.PerformTask(IProjectComponentCreator componentCreator, ProjectCreationContext context, XmlNode taskXml)
       at Microsoft.VisualStudio.TeamFoundation.PCW.ProjectCreationEngine.RunTask(Object taskObj)
    --   Inner Exception   --
    Exception Message: TF237070: Importing the definition failed. The definition you are trying to import did not validate against the schema. Edit the definition, then try to import it again. (type ProvisionValidationException)
    Exception Stack Trace:    at Microsoft.TeamFoundation.WorkItemTracking.Client.Provision.ProvisionClass.GetXml(TextReader stream, SchemaType type, ImportEventHandler handler)
       at Microsoft.TeamFoundation.WorkItemTracking.Client.Provision.ProvisionClass.GetXml(Stream stream, SchemaType type, ImportEventHandler handler)
       at Microsoft.TeamFoundation.WorkItemTracking.Client.Provision.ProvisionClass.ValidateCategories(Stream stream, Dictionary`2 types)
       at Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.WitPcwPlugin.PcwPluginComponentCreator.WitPcwTask.CategoriesTask.Load(Boolean import)
       at Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.WitPcwPlugin.PcwPluginComponentCreator.WitPcwTask.CategoriesTask.Validate()
       at Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.WitPcwPlugin.PcwPluginComponentCreator.Parse(ContextWrapper wrapper, XmlNode taskXml, Boolean fExecute)
       at Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.WitPcwPlugin.PcwPluginComponentCreator.Validate(ProjectCreationContext ctxt, XmlNode taskXml)

    --- end Exception entry ---

    Here is the file:

    <?xml version="1.0" encoding="utf-8"?>
    <cat:CATEGORIES xmlns:cat="http://schemas.microsoft.com/VisualStudio/2008/workitemtracking/categories">
      <!-- Usage: for resilience in Test system. Even if WITs have different name, they can be referred to by the category -->
      <CATEGORY name="Bug Category" refname="Microsoft.BugCategory">
        <DEFAULTWORKITEMTYPE name="Bug" />
      </CATEGORY>
      <CATEGORY name="Requirement Category" refname="Microsoft.RequirementCategory">
        <DEFAULTWORKITEMTYPE name="Product Backlog Item" />
        <WORKITEMTYPE name="Bug" />
      </CATEGORY>
      <CATEGORY name="Test Case Category" refname="Microsoft.TestCaseCategory">
        <DEFAULTWORKITEMTYPE name="Test Case" />
      </CATEGORY>
      <CATEGORY name="Shared Step Category" refname="Microsoft.SharedStepCategory">
        <DEFAULTWORKITEMTYPE name="Shared Steps" />
      </CATEGORY>
      <CATEGORY name="Code Review Request Category" refname="Microsoft.CodeReviewRequestCategory">
        <DEFAULTWORKITEMTYPE name="Code Review Request" />
      </CATEGORY>
      <CATEGORY name="Code Review Response Category" refname="Microsoft.CodeReviewResponseCategory">
        <DEFAULTWORKITEMTYPE name="Code Review Response" />
      </CATEGORY>
      <CATEGORY name="Feedback Request Category" refname="Microsoft.FeedbackRequestCategory">
        <DEFAULTWORKITEMTYPE name="Feedback Request" />
      </CATEGORY>
      <CATEGORY name="Feedback Response Category" refname="Microsoft.FeedbackResponseCategory">
        <DEFAULTWORKITEMTYPE name="Feedback Response" />
      </CATEGORY>
      <CATEGORY name="Task Category" refname="Microsoft.TaskCategory">
        <DEFAULTWORKITEMTYPE name="Task" />
      </CATEGORY>
      <CATEGORY name="Hidden Types Category" refname="Microsoft.HiddenCategory">
        <DEFAULTWORKITEMTYPE name="Code Review Request" />
        <WORKITEMTYPE name="Code Review Response" />
        <WORKITEMTYPE name="Feedback Request" />
        <WORKITEMTYPE name="Feedback Response" />
        <WORKITEMTYPE name="Shared Steps" />
      </CATEGORY>
    </cat:CATEGORIES>

    Wednesday, November 14, 2012 11:02 PM

Answers

  •   <CATEGORY refname="Microsoft.TaskCategory" name="Task Category">
        <DEFAULTWORKITEMTYPE name="Task" />
        <DEFAULTWORKITEMTYPE name="Bug" />
      </CATEGORY>
    

    You have the DEFAULTWORKITEMTYPE twice in this category. Change it to

      <CATEGORY refname="Microsoft.TaskCategory" name="Task Category">
        <DEFAULTWORKITEMTYPE name="Task" />
        <WORKITEMTYPE name="Bug" />
      </CATEGORY>
    


    Please remember to mark the replies as answers if they help.

    • Marked as answer by Gavin Stevens Monday, November 19, 2012 9:34 PM
    Monday, November 19, 2012 7:49 PM

All replies

  • Hi Gavin,

    Thanks for your post!

    I recommend you re-upload the scrum 2.0 template process from the following path:

    C:\Program Files\Microsoft Team Foundation Server 11.0\Tools\Deploy\ProcessTemplateManagerFiles\1033\Scrum\

    Please feel free to let me know if it work.

    Best Regards,


    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, November 15, 2012 9:21 AM
  • I have tried to repro this issue based on your steps, and I was unable to do that.

    This is what I did on a TFS 2012 RTM machine

    1. Create a new collection
    2. Download the Scrum 2.0 template
    3. Delete the Scrum 2.0 template
    4. Upload the downloaded scrum template

    Do you have an English TFS installation? Is there anything else that I need to know to repro this issue? Could you please try as Cathy suggested?

    Thanks


    Please remember to mark the replies as answers if they help.

    Thursday, November 15, 2012 5:19 PM
  • To which version of TFS are you uploading the file? Is it TFS 2012 RTM?

    Could you upload the zip file that you are using somewhere (like SkyDrive)?


    Please remember to mark the replies as answers if they help.

    Thursday, November 15, 2012 5:52 PM
  • Well, the default under C:\Program Files\Microsoft Team Foundation Server 11.0\Tools\Deploy\ProcessTemplateManagerFiles\1033\Scrum\ uploaded correctly.  I'm looking at my mods to see if I can find the problem.

    The error message below is misleading as the Category.xml file hasn't changed.  Some other change must be causing this.  I'll have to work backwards from the default template to find the real problem.

    Time: 2012-11-19T10:33:02
    Module: Work Item Tracking
    Exception Message: The element 'CATEGORY' has invalid child element 'DEFAULTWORKITEMTYPE'. List of possible elements expected: 'WORKITEMTYPE'. (type XmlSchemaValidationException)
    Exception Stack Trace:

    --- end Exception entry ---

    ---begin Exception entry---
    Time: 2012-11-19T10:33:02
    Module: Engine
    Event Description: TF30162: Task "Categories" from Group "WorkItemTracking" failed
    Exception Type: Microsoft.TeamFoundation.Client.PcwException
    Exception Message: TF237070: Importing the definition failed. The definition you are trying to import did not validate against the schema. Edit the definition, then try to import it again.
    Stack Trace:
       at Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.WitPcwPlugin.PcwPluginComponentCreator.Validate(ProjectCreationContext ctxt, XmlNode taskXml)
       at Microsoft.VisualStudio.TeamFoundation.PCW.ProjectCreationEngine.TaskValidator.PerformTask(IProjectComponentCreator componentCreator, ProjectCreationContext context, XmlNode taskXml)
       at Microsoft.VisualStudio.TeamFoundation.PCW.ProjectCreationEngine.RunTask(Object taskObj)
    --   Inner Exception   --
    Exception Message: TF237070: Importing the definition failed. The definition you are trying to import did not validate against the schema. Edit the definition, then try to import it again. (type ProvisionValidationException)
    Exception Stack Trace:    at Microsoft.TeamFoundation.WorkItemTracking.Client.Provision.ProvisionClass.GetXml(TextReader stream, SchemaType type, ImportEventHandler handler)
       at Microsoft.TeamFoundation.WorkItemTracking.Client.Provision.ProvisionClass.GetXml(Stream stream, SchemaType type, ImportEventHandler handler)
       at Microsoft.TeamFoundation.WorkItemTracking.Client.Provision.ProvisionClass.ValidateCategories(Stream stream, Dictionary`2 types)
       at Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.WitPcwPlugin.PcwPluginComponentCreator.WitPcwTask.CategoriesTask.Load(Boolean import)
       at Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.WitPcwPlugin.PcwPluginComponentCreator.WitPcwTask.CategoriesTask.Validate()
       at Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.WitPcwPlugin.PcwPluginComponentCreator.Parse(ContextWrapper wrapper, XmlNode taskXml, Boolean fExecute)
       at Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.WitPcwPlugin.PcwPluginComponentCreator.Validate(ProjectCreationContext ctxt, XmlNode taskXml)

    --- end Exception entry ---

    Monday, November 19, 2012 5:35 PM
  • So, it turns out, I've made changes to the Common Process Config file.

    This is a brand new server, I have yet to create any team projects. 

    I want to create the first team project with our custom process template.

    I've updated the process config under WorkItemTracking\Process\CommonConfiguration.xml

    This appears to be the point in the template mods where I can no longer upload my template.


    • Edited by Gavin Stevens Monday, November 19, 2012 9:05 PM Template not needed
    Monday, November 19, 2012 7:14 PM
  • Looking at my template, there are a few major things I've changed.

    I've changed the PBI/Bug workflow to: New -> Not Done -> In Progress -> Done ->Deleted

    Also the Task workflow to: New -> In Progress -> Peer Review -> Validate -> Done -> Deleted

    This makes me update The CommonConfiguration file to reflect the proper workflow stages for the Web UI.

    I changed this from:

    <TaskWorkItems category="Microsoft.TaskCategory">
        <States>
          <State value="To Do" type="Proposed" />
          <State value="In Progress" type="InProgress" />
          <State value="Done" type="Complete" />
        </States>
      </TaskWorkItems>

    To:

    <TaskWorkItems category="Microsoft.TaskCategory" plural="Backlog tasks">
        <States>
          <State type="Proposed" value="New" />
          <State type="InProgress" value="In Progress" />
          <State type="InProgress" value="Peer Review" />
          <State type="InProgress" value="Validate" />
          <State type="Complete" value="Done" />
        </States>
      </TaskWorkItems>
      <BugWorkItems category="Microsoft.BugCategory" plural="Backlog defects">
        <States>
          <State type="Proposed" value="New" />
          <State type="Proposed" value="Not Done" />
          <State type="InProgress" value="In Progress" />
          <State type="Complete" value="Done" />
        </States>
      </BugWorkItems>

    Also, in the Categories.xml

    I changed:

     <CATEGORY name="Bug Category" refname="Microsoft.BugCategory">
        <DEFAULTWORKITEMTYPE name="Bug" />
      </CATEGORY>
      <CATEGORY name="Requirement Category" refname="Microsoft.RequirementCategory">
        <DEFAULTWORKITEMTYPE name="Product Backlog Item" />
        <WORKITEMTYPE name="Bug" />
      </CATEGORY>
      <CATEGORY name="Test Case Category" refname="Microsoft.TestCaseCategory">
        <DEFAULTWORKITEMTYPE name="Test Case" />
      </CATEGORY>
      <CATEGORY name="Shared Step Category" refname="Microsoft.SharedStepCategory">
        <DEFAULTWORKITEMTYPE name="Shared Steps" />
      </CATEGORY>
      <CATEGORY name="Code Review Request Category" refname="Microsoft.CodeReviewRequestCategory">
        <DEFAULTWORKITEMTYPE name="Code Review Request" />
      </CATEGORY>
      <CATEGORY name="Code Review Response Category" refname="Microsoft.CodeReviewResponseCategory">
        <DEFAULTWORKITEMTYPE name="Code Review Response" />
      </CATEGORY>
      <CATEGORY name="Feedback Request Category" refname="Microsoft.FeedbackRequestCategory">
        <DEFAULTWORKITEMTYPE name="Feedback Request" />
      </CATEGORY>
      <CATEGORY name="Feedback Response Category" refname="Microsoft.FeedbackResponseCategory">
        <DEFAULTWORKITEMTYPE name="Feedback Response" />
      </CATEGORY>
      <CATEGORY name="Task Category" refname="Microsoft.TaskCategory">
        <DEFAULTWORKITEMTYPE name="Task" />
      </CATEGORY>

    To:

    <CATEGORY refname="Microsoft.BugCategory" name="Bug Category">
        <DEFAULTWORKITEMTYPE name="Bug" />
      </CATEGORY>
      <CATEGORY refname="Microsoft.CodeReviewRequestCategory" name="Code Review Request Category">
        <DEFAULTWORKITEMTYPE name="Code Review Request" />
      </CATEGORY>
      <CATEGORY refname="Microsoft.CodeReviewResponseCategory" name="Code Review Response Category">
        <DEFAULTWORKITEMTYPE name="Code Review Response" />
      </CATEGORY>
      <CATEGORY refname="Microsoft.FeedbackRequestCategory" name="Feedback Request Category">
        <DEFAULTWORKITEMTYPE name="Feedback Request" />
      </CATEGORY>
      <CATEGORY refname="Microsoft.FeedbackResponseCategory" name="Feedback Response Category">
        <DEFAULTWORKITEMTYPE name="Feedback Response" />
      </CATEGORY>
      <CATEGORY refname="Microsoft.HiddenCategory" name="Hidden Types Category">
        <DEFAULTWORKITEMTYPE name="Code Review Request" />
        <WORKITEMTYPE name="Code Review Response" />
        <WORKITEMTYPE name="Feedback Request" />
        <WORKITEMTYPE name="Feedback Response" />
        <WORKITEMTYPE name="Shared Steps" />
      </CATEGORY>
      <CATEGORY refname="Microsoft.RequirementCategory" name="Requirement Category">
        <DEFAULTWORKITEMTYPE name="Product Backlog Item" />
      </CATEGORY>
      <CATEGORY refname="Microsoft.SharedStepCategory" name="Shared Step Category">
        <DEFAULTWORKITEMTYPE name="Shared Steps" />
      </CATEGORY>
      <CATEGORY refname="Microsoft.TaskCategory" name="Task Category">
        <DEFAULTWORKITEMTYPE name="Task" />
        <DEFAULTWORKITEMTYPE name="Bug" />
      </CATEGORY>
      <CATEGORY refname="Microsoft.TestCaseCategory" name="Test Case Category">
        <DEFAULTWORKITEMTYPE name="Test Case" />
      </CATEGORY>

    These changes appear correct to me, but obviously something is not jiving here.

    Any ideas?

    Gavin

    Monday, November 19, 2012 7:22 PM
  •   <CATEGORY refname="Microsoft.TaskCategory" name="Task Category">
        <DEFAULTWORKITEMTYPE name="Task" />
        <DEFAULTWORKITEMTYPE name="Bug" />
      </CATEGORY>
    

    You have the DEFAULTWORKITEMTYPE twice in this category. Change it to

      <CATEGORY refname="Microsoft.TaskCategory" name="Task Category">
        <DEFAULTWORKITEMTYPE name="Task" />
        <WORKITEMTYPE name="Bug" />
      </CATEGORY>
    


    Please remember to mark the replies as answers if they help.

    • Marked as answer by Gavin Stevens Monday, November 19, 2012 9:34 PM
    Monday, November 19, 2012 7:49 PM
  • Ok, I got it to work..  Apparently this is the problem:
     

      <CATEGORY refname="Microsoft.TaskCategory" name="Task Category">
        <DEFAULTWORKITEMTYPE name="Task" />
        <DEFAULTWORKITEMTYPE name="Bug" />
      </CATEGORY>
    

    Apparently duplicates aren't a good thing here..

    Changing this to: (works)

     <CATEGORY refname="Microsoft.TaskCategory" name="Task Category">
        <DEFAULTWORKITEMTYPE name="Task" />
        <WORKITEMTYPE name="Bug" />
      </CATEGORY>

    Monday, November 19, 2012 7:51 PM