我希望從我在TFS上運行的MSBuild腳本調用GetBuildProperties任務。 但是,此腳本可以在TFS 2010或TFS 2013上運行。 有沒有辦法檢測啓動MSBuild腳本的TFS版本?目前,我正在解決該問題,像這樣:從MSBuild中檢測TFS版本/安裝文件夾
<PropertyGroup>
<CurrentProgramFiles>$(ProgramW6432)</CurrentProgramFiles>
<CurrentProgramFiles Condition="$(CurrentProgramFiles) == ''">$(ProgramFiles)</CurrentProgramFiles>
</PropertyGroup>
<PropertyGroup Condition="$(TeamFoundationServerUrl)!='' and Exists('$(CurrentProgramFiles)\Microsoft Team Foundation Server 2010')">
<TeamBuildRefPath>$(CurrentProgramFiles)\Microsoft Team Foundation Server 2010\Tools</TeamBuildRefPath>
</PropertyGroup>
<PropertyGroup Condition="$(TeamFoundationServerUrl)!='' and Exists('$(CurrentProgramFiles)\Microsoft Team Foundation Server 12.0')">
<TeamBuildRefPath>$(CurrentProgramFiles)\Microsoft Team="" Foundation Server 12.0\Tools</TeamBuildRefPath>
</PropertyGroup>
<UsingTask
TaskName="Microsoft.TeamFoundation.Build.Tasks.GetBuildProperties"
AssemblyFile="$(TeamBuildRefPath)\Microsoft.TeamFoundation.Build.ProcessComponents.dll"
Condition="$(TeamFoundationServerUrl)!=''" />
你能澄清,如果你需要的TFS版本或生成代理的版本? – 2014-09-02 06:09:29
代理版本:) – Kram 2014-09-02 09:45:56