在文件读取时强制执行GetLatest

时间:2014-03-02 08:06:32

标签: visual-studio tfs msbuild azure-devops getlatest

是否可以强制用户在阅读之前获取最新文件?

我们的自定义代码分析规则集(.ruleset)就是一个例子。我不希望有人在旧版本的规则集上运行代码分析。

我们正在使用Visual Studio Online和Visual Studio 2013以及Team Foundation版本控制。

1 个答案:

答案 0 :(得分:2)

Visual Studio中没有此选项,并且总是希望对工作空间中的所有文件强制执行此操作并不是很有意义,有时您需要来构建旧版本的代码。也就是说,您可以添加一个使用TFS命令行获取这些特定文件的最新版本的预构建操作,如:

>TF get $/Project/CodeAnalysisRules/MyProject.Ruleset /version:T

项目文件中的might need to disable the UseHostCompilerIfAvailable标记为might otherwise not detect the changed file till after the build has completed