我正在尝试学习如何使用VSS和MSBuildCommunityTasks执行某些源代码控制任务,比如如何使用GetVSS和VssLabel等任务?文档没有说清楚。当我向它戳一根棍子,看看错误信息是否可以告诉我任何事情时,那么也不是很清楚该做什么。让我展示一下我正在做什么以及我正在做什么 - 我希望有人可以指出我正确的方向。
Project使用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>
我收到如下错误消息:
Target GetLatestVersionVSS: C:\Documents and Settings\michaelc\My Documents\Visual Studio 2005\Projects\Astronom\Astronomer\msbuild_UseVSS.xml(7,5): error MSB4018: The "VssGet" task failed unexpectedly. C:\Documents and Settings\michaelc\My Documents\Visual Studio 2005\Projects\Astronom\Astronomer\msbuild_UseVSS.xml(7,5): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.SourceSafe.Interop, Version=5.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. C:\Documents and Settings\michaelc\My Documents\Visual Studio 2005\Projects\Astronom\Astronomer\msbuild_UseVSS.xml(7,5): error MSB4018: Filename: 'Microsoft.VisualStudio.SourceSafe.Interop, Version=5.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ...And so on.
我可能需要在其中放置某种Import项目以指向VSS,特别是指向Microsoft.VisualStudio.SourceSafe.Interop,但我找不到该名称的.dll文件,并且它不在Visual Studio中“添加引用”对话框的.NET选项卡中的组件列表中。
答案 0 :(得分:3)
好的,我正在回答我自己的问题。
MSBuildCommunityTasks需要VS2005附带的Visual Source Safe 2005。但是,我们仍在使用VSS 6.0d,并且MSBuildCommunityTasks无法使用它。开发人员的任务指南说明:
Developer's Guide for http://msbuildtasks.tigris.org/ ===================================================== Build Environment Prerequisites ------------------------------ - .NET2.0 - MSBuild; typically already installed as part of .NET2.0, for example in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe - NUnit 2.2.X (http://www.nunit.org/); necessary to run the tests - Microsoft Visual SourceSafe(R) 2005; the library Microsoft.VisualStudio.SourceSafe.Interop gets referenced - NDoc 1.3 (http://ndoc.sourceforge.net/) additionally configure NDoc to use .NET2; see http://ndoc.sourceforge.net/wiki/dotNet_2.0_Support - Microsoft Visual Studio 2005 as IDE