http://forums.microsoft.com/msdn-cht/addpost.aspx?postid=384665&SiteID=14
































背景:
微软TFS和微软的Porject之间通过一个Mapping文件来通讯,这个文件可以下载,修改,上传。
问题解决描述:(红色部分为重点部分)
http://msdn2.microsoft.com/en-us/library/ms181686(VS.80).aspx
When you connect a project plan to Team Foundation, you may need to define how the work item fields are mapped to fields in Microsoft Project. To change how the fields are mapped, you must edit XML files.
![]() |
---|
The mapping between work item fields and Microsoft Project is specific to a team project. You can change the field mapping at any point in the project. |
![]() |
---|
If you change a column name in Microsoft Project, the column will be renamed when you refresh from Team Foundation. If you want to change a column name permanently, use the TFSFieldMapping utility. |
To view how work item fields are mapped to Microsoft Project
-
On the Team menu, click View Column Mappings.
Note
The mapping between work item fields and Microsoft Project is specific to a team project. You can change the field mapping at any point in the project.
-
Review how work item fields are mapped to Microsoft Project and determine if you need to make changes. If you decide to make changes, see the following procedure, "To change how work item fields are mapped to Microsoft Project".
To change how work item fields are mapped to Microsoft Project
-
Download the mapping file as follows:
-
Open a command prompt window.
-
Go to the folder where Visual Studio is installed (for example, drive:\Program Files\Microsoft Visual Studio 8), and in that folder, go to \Common 7\IDE. The TFSFieldMapping.exe utility program is in this folder.
-
Download the mapping file using the TFSFieldMapping.exe utility by typing the following at the command prompt:
TFSFieldMapping download http://Team_Foundation_Server team_project C:\MappingFile.xml
Where:
http://Team_Foundation_Server is the URL of your server.
team_project is the name of your team project.
C:\MappingFile.xml is the file name and location to which the mapping file will be downloaded.
-
-
Edit the mapping file as follows:
-
Open the mapping file you downloaded (for example, C:\MappingFile.xml) in an XML editor.
-
Add new mappings or edit existing mappings in the following format:
<Mapping WorkItemTrackingFieldReferenceName="fieldname.value" ProjectField="projectfield" />
For example:
<Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Common.Priority" ProjectField="pjTaskWBS" />
Where:
Microsoft.VSTS.Common.Priority is an existing field in the MSF for Agile Software Development process.
pjTaskWBS is the Microsoft Project field WBS for Tasks
Tip
For a full list of all the Microsoft Project field values for the ProjectField attribute, see Field Mappings in Microsoft Project.
-
If you want a field to be published to Team Foundation Server, but not refreshed from Team Foundation Server, add the PublishOnly attribute to the mapping section for that field and set the attribute to True. The default value is False, where a field is both published and refreshed from Team Foundation Server. This attribute can be used to allow team members to see a field value but not be able to change it in Team Foundation.
-
Save the mapping file.
-
-
Upload the mapping file as follows:
-
Open a command prompt window.
-
Go to the folder where Visual Studio is installed (for example, drive:\Program Files\Microsoft Visual Studio 8), and in that folder, go to \Common 7\IDE. The TFSFieldMapping.exe utility program is in this folder.
-
Upload the mapping file using the TFSFieldMapping.exe utility by typing the following at the command prompt:
TFSFieldMapping upload http://Team_Foundation_Server team_project C:\MappingFile.xml
Where:
http://Team_Foundation_Server is the URL of your server.
team_project is the name of your team project.
C:\MappingFile.xml is the file name and location from which the mapping file will be uploaded.
-
Security
To perform these procedures, you must be a member of the Project Administrators group or have the Edit project-level information and View Project-level information permissions set to Allow. Furthermore, you must have permissions to create the mapping file in the local path that you specify. For more information, see Team Foundation Server Permissions.