如何获取TFS工作区目录 [英] How to get the TFS workspace directory

查看:26
本文介绍了如何获取TFS工作区目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的 csproj 文件中访问本地工作站上的 TFS 工作区目录.我在源代码管理中有 StyleCop 文件,我需要添加绝对路径.我创建了一个环境变量并完成了这项工作.我只是想知道是否有可能获得路径,这样我的其他团队成员就不必进行任何手动配置.

I am trying to access the TFS workspace directory on my local workstation in my csproj file. I have the StyleCop files in source control and I need to add the absolute path. I created an environment variable and the does the job. I was just wondering if it was possible to get the path so my other team members would not have to do any manual configuration.

推荐答案

由于您可以在本地拥有多个工作区,因此首先要确定要从哪个工作区获取路径.之后,使用 TFS API,您可以轻松地从 csproj 文件的服务器路径中获取本地路径.构建一个创建/更新系统变量的工具很容易编写,但我不知道它是否适合你.

As you can have many Workspaces locally, the first thing would be to identify which workspace do you want to get the path from. After that, using the TFS API you can easily get the local path from the server path of your csproj file. Building a tool that create/update a sysvar can be easily written, I don't know though if it suits you.

以下是您应该在 MSDN 上调用的方法:http://msdn.microsoft.com/en-us/library/bb139272.aspx

Here's the method you should call on the MSDN: http://msdn.microsoft.com/en-us/library/bb139272.aspx

这篇关于如何获取TFS工作区目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆