tfs-sdk

Custom Check in policy in TFS?

廉价感情. 提交于 2019-12-30 05:23:33
问题 We have some xml files in the our project and whenever we check-in these xml files into TFS, We have make sure before checking-in that we have added those xml files to proprietary application. Now the new employees more often forget to add files into proprietary application before check-in and this is getting serious... We want kinda confirmation dialog (a reminder) asking the developers if they have added the xml files into the app. If yes then check-in otherwise keep it checkedout... Please

workspace.PendAdd() exact syntax?

落爺英雄遲暮 提交于 2019-12-25 14:50:01
问题 I am unable to add a new file using tfs sdk: int a = workspace.PendAdd(path,recursive ); What is this argument "Path"? path of file where to add or from where to add? or before using this method v have to copy the new file in this folder? 回答1: If you are trying to add a folder, the directory has to exist first. If you are trying to add a file, the file has to exist first. After that you can run, for example: TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("http:/

TFS API: How to check if a work item has been deleted or is non existent on the TFS Server? (not if it is accessible)

*爱你&永不变心* 提交于 2019-12-24 14:34:52
问题 I am using TFS API and I need to check if a workitem has been deleted or if it does not exist. If i use WorkItemStore.GetWorkItem(Int32) and pass the Id of a deleted Work Item here, then the message says that " The work item does not exist , or you do not have permission to access it ." I need to check only for the deleted condition and not the inaccessible condition. I've searched in the API but could not find any way to check for it. I need this because I need the list of workitems that

How can the version of a Team Foundation Server be determined programmatically?

你。 提交于 2019-12-24 09:48:55
问题 I'm working on a tool that works on both TFS2010 and TFS11. However, there are some features that are specific to TFS11, so I'd like to disable them when connecting to a server running TFS2010. Is there any way to retrieve the version of the Team Foundation Server via the TFS API? I haven't found anything in the object model available on MSDN. I found this blog post, which is interesting, but isn't a reasonable solution, since it requires using the TFS11 object model and it's entirely

TFS 2012 API - Set Version Control Permissions?

冷暖自知 提交于 2019-12-24 09:02:24
问题 I am trying to set the various version control permissions of a TFS item via the TFS API. Here is the code I am using that successfully sets the read and checkout permissions for the given folder path: IIdentityManagementService ims = tpc.GetService<IIdentityManagementService>(); TeamFoundationIdentity userIdentity = ims.ReadIdentity(IdentitySearchFactor.AccountName, "Guest", MembershipQuery.None, ReadIdentityOptions.IncludeReadFromSource); ISecurityService ss = tpc.GetService

TFS API - slow foreach changeset iteration

最后都变了- 提交于 2019-12-24 05:13:12
问题 Question Background: I am using the TFS api to query against a large range(1-600+) of files on my TFS server. From each file I am collecting all of its ChangesetId's which are then collected in a list. The code: This is the code I'm using. It works correctly producing an IEnumerable change set list of all the items for the specified parameters in the QueryHistory method. VersionSpec versionFrom = VersionSpec.ParseSingleSpec("C1", null); VersionSpec versionTo = VersionSpec.Latest; var

TFS-SDK: Merge doesn't work

我的未来我决定 提交于 2019-12-23 15:01:04
问题 As part of a bigger implementation, I'm trying to implement a merge operation of my source control branches/folders using TFS-SDK. I'm working against a TFS2010 installation. What I have is this: using System; using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.VersionControl.Client; using Microsoft.TeamFoundation.VersionControl.Common; namespace MergeBranchesFolders { class Program { static void Main() { TfsTeamProjectCollection teamProjectCollection =

How to find a Shelveset using information provided by a CodeReviewRequest

天涯浪子 提交于 2019-12-23 04:21:31
问题 If I have the name and the owner of the Shelveset, I can find it successfully using the following code: foreach (Shelveset shelveset in versionControlServer.QueryShelvesets(workItem. Fields["Associated Context"].Value.ToString(), "NW\\LFreeman")) where workItem is an instance of a CodeReviewRequest workItem . I can get the name of the CodeReviewRequest from workItem.Fields["Associated Context"] If I set the owner to null as such, it returns an empty list. It has been reported to me that this

TFS 2013 API - Retrieve all changes made for WI

自作多情 提交于 2019-12-22 18:29:07
问题 Does anybody knows how to get all changes related to work item, like how many hours were logged per day? This info is obtainable in web version of TFS in 'All Changes' tab but I couldn't find it by looking through all methods and properties of WorkItem object in debug. I've also tried to retrieve work items by WorkItem property on RevisionCollection's indexer which returns Revision object, but all these work items seems to be referencing to the final state of WI where all hours have been

How to get history of checkins/changsets for specific Team Project?

我的梦境 提交于 2019-12-22 04:46:21
问题 I'm using the TFS Client API to try and query a TFS 2010 instance. I need to be able to do the following For a specified team project, say 'Project A' Get a list of the history of recent check-ins made to this project (say the last 50, or the list for the last day) Then be able to iterate through this list and get some metadata for the items (file and folder names ideally) I think I need to use the QueryXXX methods on the VersionControlServer class, but cannot find any helpful or clear