views:

976

answers:

1

I am trying to learn how to do certain source control tasks with VSS and MSBuildCommunityTasks, like how to use tasks like GetVSS and VssLabel? Docs don't make this clear. And when I poke a stick at it to see if the error messages can tell me anything, it isn't really very clear what to do then, either. Let me show what I'm doing and what I'm getting -- I hope someone can point me in the right direction.

Project is written in C# using VS2005. Here's the MSBuild project file source:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    <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>

I get error messages as follows:

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.

It occurs to me that I might need to put some sort of Import item in there to point to VSS, specifically to point to Microsoft.VisualStudio.SourceSafe.Interop, but I cannot find a .dll file by that name, and it is not in the list of components in the .NET tab of the Add Reference dialog in Visual Studio.

+1  A: 

OK, I am answering my own question.

MSBuildCommunityTasks requires Visual Source Safe 2005, which ships with VS2005. We are, however, still using VSS 6.0d, and MSBuildCommunityTasks does not work with it. The developer's guide for the tasks states:

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
Cyberherbalist