Tag: tfs

如何使用REST API在TFS 2015中触发构建

我在本地安装了TFS 2015 RC2。 我正在尝试使用REST API在vNext定义中对构建进行排队。 我正在使用来自VSO的代码示例稍作修改(主要是更改URL和身份validation方法以使用内部部署TFS)。 我正在使用两个REST API调用。 第一个是:GET http:// mytfssrv:8080 / tfs / DefaultCollection / myproject / _apis / build / definitions / 返回所有指定的项目构建定义:ID为1的构建定义,这是一个XAML构建定义我不想排队并使用ID 2构建定义,这是vNext构建定义 – 这就是II想要对我的构建进行排队的地方 请注意,我省略了?api-version = 1.0部分 – 因为如果我不这样做,我只获得XAML构建定义。 第二个调用是在vNext构建定义中对新构建进行排队: POST http:// mytfssrv:8080 / tfs / DefaultCollection / myptoject / _apis / build / requests?api-version = 1.0 以下数据: {“definition”:{“id”:**2**},”reason”:”Manual”,”priority”:”Normal”,”queuePosition”:0,”queueTime”:”0001-01-01T00:00:00″,”requestedBy”:null,”id”:0,”status”:null,”url”:null,”builds”:null} 我从服务器得到的响应是: TF215016:构建定义2不存在。 […]

nunit测试仅在作为tfs msbuild进程的一部分运行时抛出exception

我正在使用TFS 2012从Visual Studio 2015构建和部署解决方案,没有任何问题。 我决定将我的unit testing作为构建过程的先决条件的一部分。 独立于msbuild进程,unit testing运行没有问题并成功; 但是,当我将它们作为构建过程的一部分合并时,我在构建中遇到以下exception: Exception NUnit.Core.UnsupportedFrameworkException, Exception thrown executing tests in D:\Builds\4\PA1111CE\Dev1111dBus\bin\mmmTests.dll No test is available in D:\Builds\4\PA1111CE\Dev1111dBus\bin\mmmTests.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again. 构建部分成功。 为了确保运行测试,我将Process中的Disable Tests属性设置为false: 除此之外,我还为自动化测试设置了选项: 唯一可用的测试跑步者如下: 另外,根据我的扩展和更新,它显示我确实安装了nunit适配器3: 我究竟做错了什么? 为什么我的构建仅部分成功?

如何使用Team Foundation Server SDK获取最新版本的源代码?

我正在尝试使用SDK以编程方式从TFS中提取最新版本的源代码,而我所做的以某种方式不起作用: string workspaceName = “MyWorkspace”; string projectPath = “/TestApp”; string workingDirectory = “C:\Projects\Test\TestApp”; VersionControlServer sourceControl; // actually instantiated before this method… Workspace[] workspaces = sourceControl.QueryWorkspaces(workspaceName, sourceControl.AuthenticatedUser, Workstation.Current.Name); if (workspaces.Length > 0) { sourceControl.DeleteWorkspace(workspaceName, sourceControl.AuthenticatedUser); } Workspace workspace = sourceControl.CreateWorkspace(workspaceName, sourceControl.AuthenticatedUser, “Temporary Workspace”); try { workspace.Map(projectPath, workingDirectory); GetRequest request = new GetRequest(new ItemSpec(projectPath, RecursionType.Full), VersionSpec.Latest); GetStatus […]

visual studio 2010条件参考

我们在这里有多个产品共享一些公共库。 这些库是单独解决方案的一部分(因此它们可以由TFS独立构建),但问题是在开发期间,必须修改公共库,将其编译为二进制文件,将其复制到公共位置,编译产品解决方案。 为了避免这种情况,我想知道它是否可能有条件引用,因此对于调试配置,我会将它们作为项目引用引用,而在发布配置中它们将是二进制引用。