MSBuildとMSBuildCommunityTasks(VSS)が連携して動作するのに問題がある

StackOverflow https://stackoverflow.com/questions/205676

  •  03-07-2019
  •  | 
  •  

質問

GetVSSやVssLabelなどのタスクの使用方法など、VSSおよびMSBuildCommunityTasksを使用して特定のソース管理タスクを実行する方法を学習しようとしていますか?ドキュメントはこれを明確にしません。そして、エラーメッセージが何かを教えてくれるかどうかを確認するために棒を突くと、そのときどうするかはあまり明確ではありません。私が何をしていて何をしているのかを見せてください-誰かが私を正しい方向に向けてくれることを願っています。

プロジェクトは、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.

VSS、具体的にはMicrosoft.VisualStudio.SourceSafe.Interopを指すために何らかのインポート項目をそこに入れる必要があるかもしれませんが、その名前の.dllファイルを見つけることができません。 Visual Studioの[参照の追加]ダイアログの[.NET]タブにあるコンポーネントのリストにはありません。

役に立ちましたか?

解決

OK、私は自分の質問に答えています。

MSBuildCommunityTasksには、VS2005に付属のVisual Source Safe 2005が必要です。ただし、VSS 6.0dを使用しているため、MSBuildCommunityTasksはVSS 6.0dでは動作しません。タスクの開発者ガイドには次のように記載されています。

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
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top