我正在尝试学习如何使用 VSS 和 MSBuildCommunityTasks 执行某些源代码控制任务,例如如何使用 GetVSS 和 VssLabel 之类的任务?文档没有说明这一点。当我戳它看错误消息是否能告诉我任何事情时,也不是很清楚该怎么做。让我展示一下我在做什么以及我得到了什么——我希望有人能指出我正确的方向。
项目是使用 VS2005 用 C# 编写的。这是 MSBuild 项目文件源:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<Target Name="GetLatestVersionVSS">
<VssGet DatabasePath="C:\VSS\Astronom_VSS"
Path="$/Astronom_VSS"
LocalPath="C:\VisualStudioSource\AstronomySolution\Astronom" UserName="build" Password="build" />
</Target>
<Target Name="Compile" DependsOnTargets="GetLatestVersionVSS">
<MSBuild Projects="Astronomer.x.csproj" />
</Target>
</Project>
我收到如下错误消息:
目标 GetLatestVersionVSS: C:\Documents and Settings\michaelc\My Documents\Visual Studio 2005\Projects\Astronom\Astronomer\msbuild_UseVSS.xml(7,5): 错误 MSB4018:“VssGet”任务意外失败。 C:\Documents and Settings\michaelc\My Documents\Visual Studio 2005\Projects\Astronom\Astronomer\msbuild_UseVSS.xml(7,5): 错误 MSB4018:System.IO.FileNotFoundException:无法加载文件或程序集 'Microsoft.VisualStudio.SourceSafe.Interop,版本 = 5.2.0.0,文化 = 中性,PublicKeyToken = b03f5f7f11d50a3a' 或其依赖项之一。该系统找不到指定的文件。 C:\Documents and Settings\michaelc\My Documents\Visual Studio 2005\Projects\Astronom\Astronomer\msbuild_UseVSS.xml(7,5): 错误 MSB4018:文件名:'Microsoft.VisualStudio.SourceSafe.Interop,版本 = 5.2.0.0,文化 = 中性, PublicKeyToken=b03f5f7f11d50a3a' ...等等。
我突然想到,我可能需要在其中放置某种 Import 项以指向 VSS,特别是指向 Microsoft.VisualStudio.SourceSafe.Interop,但我找不到该名称的 .dll 文件,而且不是在 Visual Studio 中“添加引用”对话框的 .NET 选项卡中的组件列表中。