【发布时间】:2011-06-09 14:01:39
【问题描述】:
我正在尝试实现我在这篇文章中看到的内容:TFS and msbuild version number with last changeset。也就是说,我试图在构建时获取最后一个变更集编号,以便可以在 AssemblyVersionInfo.cs 中使用它。
我正在使用 VS 2008 和 TFS 2008。我已经安装了 MSBuild 扩展包 v3.5.9.0 (x64)。它位于 C:\Program Files\MSBuild\ExtensionPack 中。这是我的 MSBuild 项目:
<Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="C:\Program Files\MSBuild\ExtensionPack\MSBuild.ExtensionPack.tasks"/>
<Target Name="Default">
<TfsVersion TfsLibraryLocation="C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies"
LocalPath="$(SolutionRoot)">
<Output TaskParameter="Changeset" PropertyName="ChangesetNumber"/>
</TfsVersion>
<Message Text="TFS ChangeSetNumber: $(ChangesetNumber)" />
</Target>
</Project>
这是我运行脚本的方式:
C:\Build\TeamBuildTypes\Nightly_Main>MSbuild test.proj
这是我的错误信息:
C:\Build\TeamBuildTypes\Nightly_Main\test.proj(4,5): error MSB4062: The "MSBuild.ExtensionPack.VisualStudio.TfsVersion" task could not be loaded from the asse
mbly C:\Program Files (x86)\MSBuild\ExtensionPack\MSBuild.ExtensionPack.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\ExtensionPack\MSBuild.ExtensionPack.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available.
任何帮助表示赞赏。
谢谢, 斯科特
【问题讨论】:
-
听起来很明显,但是......该文件是否真的存在于构建机器上?它可能是一个 32 位操作系统。有没有看融合日志看是不是依赖问题?
-
版本属性编号限制为 uint16,因此虽然这种方法很好,但您最终将无法对程序集进行版本控制。
标签: visual-studio-2008 msbuild tfsbuild msbuildcommunitytasks