Question

Is there any built-in macro to obtain the TFS Sourcecontrol Root directory in Visual Studio?

For example just like $(ProjectDir), I would use $(TFSSourceControlRoot) or something like that?

The reason I need this is to in order to use this path in the xcopy command which I will need as a part of a post build action. Instead of writing something like C:\Source\Scripts, I want to write something like $(TFSSourceControlRootDir)\Source\Scripts.

Était-ce utile?

La solution

If you mean the root of the folder structure on the server, then you can refer to it as simply $/. However, if you mean the local folder that this is mapped to, there's not a macro for that. The reason is that you can map any number of folders in the server hierarchy to local disk folders, so there's not necessarily a single root - and there's not necessarily a folder that maps to $/ at all.

(That said, if you can explain why you need it, there might be alternative suggestions...)

Autres conseils

For newer searchers, I found this build variable page, and this is TFS 2015 specific, but it has:

BUILD_SOURCESDIRECTORY

The local path on the agent where your source code files are downloaded. For example: c:\agent_work\1\s.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top