Error message when you try to import a work item type in Visual Studio Team Foundation Server: "Cannot complete the operation" (921319)
The information in this article applies to:
- Microsoft Visual Studio 2005 Team System Team Foundation:
SYMPTOMSWhen you try to import a work item type in Microsoft Visual Studio 2005 Team Foundation Server, you receive the following error message: Cannot complete the operation. An unexpected error occurred. CAUSEThis problem occurs if the following conditions are true: - You modify an existing rule by setting both the for attribute and the not attribute.
- The existing rule already had one of the two attributes set.
WORKAROUNDTo work around this problem, remove the rule that causes the problem from the original work item type, and then import the updated work item type.
Modify the work item type by creating the rule with both the for attribute and the not attribute, and then
import the updated work item type again. To do this, follow these steps: - Assume that you have the following work item type already imported into your project.
<?xml version="1.0" encoding="utf-8"?>
<wit:WITD xmlns:wit="http://schemas.microsoft.com/VisualStudio/2005/workitemtracking/typedef" version="1.0">
<WORKITEMTYPE name="000.001">
<FIELDS>
<FIELD refname="D000.001" name="001" type="String">
<ALLOWEDVALUES for="[global]\Team Foundation Administrators">
<LISTITEM value="Item 1"/>
<LISTITEM value="Item 2"/>
</ALLOWEDVALUES>
</FIELD>
</FIELDS>
<WORKFLOW>
<STATES>
<STATE value="State 1"/>
</STATES>
<TRANSITIONS>
<TRANSITION from="" to="State 1">
<REASONS>
<DEFAULTREASON value="State *-1-1"/>
</REASONS>
</TRANSITION>
</TRANSITIONS>
</WORKFLOW>
<FORM>
<Layout/>
</FORM>
</WORKITEMTYPE>
</wit:WITD>
- Modify the work item type by removing the original rule, and then save the file as 1.xml. The XML will resemble the following.
<?xml version="1.0" encoding="utf-8"?>
<wit:WITD xmlns:wit="http://schemas.microsoft.com/VisualStudio/2005/workitemtracking/typedef" version="1.0">
<WORKITEMTYPE name="000.001">
<FIELDS>
<FIELD refname="D000.001" name="001" type="String">
</FIELD>
</FIELDS>
<WORKFLOW>
<STATES>
<STATE value="State 1"/>
</STATES>
<TRANSITIONS>
<TRANSITION from="" to="State 1">
<REASONS>
<DEFAULTREASON value="State *-1-1"/>
</REASONS>
</TRANSITION>
</TRANSITIONS>
</WORKFLOW>
<FORM>
<Layout/>
</FORM>
</WORKITEMTYPE>
</wit:WITD> - Click Start, click Run, type cmd, and then click OK.
- Type the following command, and then press ENTER:
cd C:\Program Files\Microsoft Visual Studio 8\Common7\IDE - Type the following command, and then press ENTER:
witimport /f 1.xml /t Team_Foundation_Server_Name /p Project_Name - Modify the work item type by adding the rule again. Add both the for attribute and the not attribute. The XML file will resemble the following.
<?xml version="1.0" encoding="utf-8"?>
<wit:WITD xmlns:wit="http://schemas.microsoft.com/VisualStudio/2005/workitemtracking/typedef" version="1.0">
<WORKITEMTYPE name="000.001">
<FIELDS>
<FIELD refname="D000.001" name="001" type="String">
<ALLOWEDVALUES for="[global]\Team Foundation Administrators" not="[global]\Team Foundation Valid Users" >
<LISTITEM value="Item 1"/>
<LISTITEM value="Item 2"/>
</ALLOWEDVALUES>
</FIELD>
</FIELDS>
<WORKFLOW>
<STATES>
<STATE value="State 1"/>
</STATES>
<TRANSITIONS>
<TRANSITION from="" to="State 1">
<REASONS>
<DEFAULTREASON value="State *-1-1"/>
</REASONS>
</TRANSITION>
</TRANSITIONS>
</WORKFLOW>
<FORM>
<Layout/>
</FORM>
</WORKITEMTYPE>
</wit:WITD>
- At the command prompt, type the following command, and then press ENTER:
witimport /f 1.xml /t Team_Foundation_Server_Name /p Project_Name
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Minor | Last Reviewed: | 9/8/2006 |
---|
Keywords: | kberrmsg kbtshoot kbinfo kbBug kbprb KB921319 kbAudDeveloper kbAudITPRO |
---|
|