让 MSBuild 和 MSBuildCommunityTasks (VSS) 协同工作时遇到问题

发布于 2024-07-07 21:41:50 字数 1939 浏览 5 评论 0原文

我正在尝试学习如何使用 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>

我收到如下错误消息:

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 选项卡的组件列表中。

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">
    <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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

薄荷→糖丶微凉 2024-07-14 21:41:50

好吧,我正在回答我自己的问题。

MSBuildCommunityTasks 需要 Visual Source Safe 2005,它随 VS2005 一起提供。 但是,我们仍在使用 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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文