DownloadFiles
不是您可以使用的活动,它意味着处理驻留在Source控件中的文件。
相反,您需要建立到TFS的Sharepoint复制服务的连接,该服务驻留在处。我们通过在构建解决方案中添加服务参考来实现这一点。
然后,我们实现了一个构建活动,它基本上与您之后的构建活动完全相反:在TFS构建过程中,它将文档上载到Sharepoint。
实例化看起来是这样的:
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
EndpointAddress endpointAddress = new EndpointAddress("http://<Site>/_vti_bin/Copy.asmx");
CopySoapClient copyService = new CopySoapClient(binding,endpointAddress);
此副本服务公开一个GetItem
方法,这是你可能应该调用一个。
我不知道这是否是GetItem
能够支持http://myServer/sites/MyProject/Test/*.doc
种事情
这些文件不在源代码控制 - 他们是在SharePoint。 –
@JohnSaunders:是的,我提到它“虽然他们有一个Sharepoint Web服务器路径...”。但是有什么办法让他们通过工作流程?感谢您回答 – GoRoS
请说出你想要完成的事情。 “让他们”不是很具描述性。 –