0

I have a bit of a strange problem. I was trying to add a new State to my UserStory type via the Team Project Manager tool (http://teamprojectmanager.codeplex.com/). In the inline editor I added a new and clicked Ok. Clearly I did something wrong as it errored out. When I tried to open it again, all the context except the root xml tag was gone.

Naturally now my Product Backlog doesnt work. It says

"TF400917: The current configuration is not valid for this feature. This feature cannot be used until you correct the configuration."

I can load the queries section of the backlog and view all the stories & tasks, but the backlog just won't load. I have downloaded all available templates from Visual Studio and compared them, even uploaded them. Nothing fixes the backlog. I am not sure what template it's using for the backlog sadly. I have spent the last 3 days trying to fix this to no avail. We dont really have anything in the backlog that we would be sad to lose but creating a new Collection and starting over is out of the question.

I have no idea what to do. Any help I could get would be awesome. Thank you.

Oh, I opened the log from the Team Project Manager and I think this is the error that it threw that caused the problem:

TeamProjectManager Error: 0 :       [T01] [1/22/2016 3:36:22 PM] An unexpected exception occurred while importing work item types: Root element is missing.
System.Xml.XmlException: Root element is missing.
    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
    at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
    at System.Xml.XmlTextReaderImpl.Read()
    at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
    at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
    at System.Xml.XmlDocument.Load(XmlReader reader)
    at System.Xml.XmlDocument.LoadXml(String xml)
    at TeamProjectManager.Modules.WorkItemConfiguration.WorkItemConfigurationItemImportExport.ReplaceTeamProjectMacros(XmlDocument xml, IDictionary`2 macros) in C:\Users\jelled\Desktop\Code\TeamProjectManager\Main\TeamProjectManager.Modules.WorkItemConfiguration\WorkItemConfigurationItemImportExport.cs:line 284
    at TeamProjectManager.Modules.WorkItemConfiguration.WorkItemConfigurationItemImportExport.Import(ILogger logger, ApplicationTask task, Boolean setTaskProgress, WorkItemStore store, Dictionary`2 teamProjectsWithConfigurationItems, ImportOptions options) in C:\Users\jelled\Desktop\Code\TeamProjectManager\Main\TeamProjectManager.Modules.WorkItemConfiguration\WorkItemConfigurationItemImportExport.cs:line 31
    at TeamProjectManager.Modules.WorkItemConfiguration.WorkItemTypesViewModel.<>c__DisplayClass101_0.<PerformImport>b__1(Object sender, DoWorkEventArgs e) in C:\Users\jelled\Desktop\Code\TeamProjectManager\Main\TeamProjectManager.Modules.WorkItemConfiguration\WorkItemTypesViewModel.cs:line 616
    at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
    at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
Icestorm0141
  • 662
  • 2
  • 9
  • 21
  • If you use witadmin to export the user story template xml, does it produce a valid XML file? `witadmin exportwitd /collection:http://server:8080/TFS/collection /p:project /n:"User Story" /f:C:\temp\userstory.xml`. Needs to be run in the Visual Studio Command Prompt. – KMB Jan 25 '16 at 15:40

1 Answers1

0

In case anyone stumbles upon this looking for an answer, I fixed it. After 2 days of struggling I fixed it.

In the Team Project Manager, open the ProcessConfiguration xml file. Look at all the defined states for your backlogs. Open the corresponding XML files, look at all the defined states there. They have to match.

Specific solution for me:

Opened UserStory WIT, as this was the only xml file I remember editting before the problem occurred. Compared defined states to those defined under . They need to match. I had an extra state listed in the UserStory definition that wasnt listed in the process configuration.

When I tried to upload, I still got an error. However, the error it gave me was extremely helpful:

An error occurred while importing Process Configuration in Team Project "IMT": System.Web.Services.Protocols.SoapException: The following element contains an error: TaskBacklog/States. TF400536: This element defines the states for work items that appear on your backlog. The initial state value for each work item type must match one of the states defined in this element. The following work item types have an initial state that is not included in the defined states: 'Task'.
   at Microsoft.TeamFoundation.Server.WebAccess.Agile.WebServices.ProcessConfigurationService3.SetProjectProcessConfiguration(String projectUri, ProjectProcessConfiguration processConfiguration)
        System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: The following element contains an error: TaskBacklog/States. TF400536: This element defines the states for work items that appear on your backlog. The initial state value for each work item type must match one of the states defined in this element. The following work item types have an initial state that is not included in the defined states: 'Task'.
   at Microsoft.TeamFoundation.Server.WebAccess.Agile.WebServices.ProcessConfigurationService3.SetProjectProcessConfiguration(String projectUri, ProjectProcessConfiguration processConfiguration)
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.HandleReply(TfsClientOperation operation, TfsMessage message, Object[]& outputs)
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation, Object[] parameters, TimeSpan timeout, Object[]& outputs)
   at Microsoft.TeamFoundation.ProcessConfiguration.Client.ProcessConfigurationService3.SetProjectProcessConfiguration(String projectUri, ProjectProcessConfiguration processConfiguration)
   at Microsoft.TeamFoundation.ProcessConfiguration.Client.ProjectProcessConfigurationService.SetProcessConfiguration(String projectUri, ProjectProcessConfiguration processConfiguration)
   at TeamProjectManager.Modules.WorkItemConfiguration.WorkItemConfigurationItemImportExport.SetProcessConfiguration(Project project, WorkItemConfigurationItemType type, WorkItemConfigurationItem item) in C:\Users\jelled\Desktop\Code\TeamProjectManager\Main\TeamProjectManager.Modules.WorkItemConfiguration\WorkItemConfigurationItemImportExport.cs:line 537
   at TeamProjectManager.Modules.WorkItemConfiguration.WorkItemConfigurationItemImportExport.Import(ILogger logger, ApplicationTask task, Boolean setTaskProgress, WorkItemStore store, Dictionary`2 teamProjectsWithConfigurationItems, ImportOptions options) in C:\Users\jelled\Desktop\Code\TeamProjectManager\Main\TeamProjectManager.Modules.WorkItemConfiguration\WorkItemConfigurationItemImportExport.cs:line 119

Failed

The very end of the first line is the most helpful : The following work item types have an initial state that is not included in the defined states: 'Task'.

I repeated the above process with the Task WIT, and it fixed it! I have no idea how the task WIT got out of sync though....don't remember updating that one. Oh well.

Icestorm0141
  • 662
  • 2
  • 9
  • 21