Multiple Questions concerning VB6 Build

May 7, 2009 at 8:13 PM
Edited May 7, 2009 at 8:35 PM
I have read every thread in this discussion board regarding my build of VB6 code.  I have inherted 125 different VB6 projects and I have been able to create a .proj file and build each project successfully using the few discussions that are posted here but I have a few other questions to complete the process.

1.  I am using Visual Studio 2008 and TFS 2008 and the SetBuildProperties is still not supported so my buillds always fail even though the code has successfully compiled.  What do I need to do to get this property?  I should have it already but its not supported...

2.  I need to pull new code for continuous integration so I have been trying tp use the TfsSouce "Get" command and the exact command when execuated in a command prompt works successfully but not within the .proj script.

Here is the exact script which has been consolidated to only build one project and pull all the code.
-------------------------------------------------------------------------------------------------------------------------------------------------
<Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>
  <ItemGroup>
    <ProjectsToBuild Include="C:\Freedom\Source\FreedomSDK\FreedomSDK.vbp">
      <OutDir>F:\Executables</OutDir>
    </ProjectsToBuild>
  </ItemGroup>
  <Target Name="Default">
    <!-- Get most recent source -->
    <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Get" ItemPath="$/ERP_Easy/Development/0-MAIN/Freedom" Force="true"/>
     
    <!-- Build a collection of VB6 projects -->
    <MSBuild.ExtensionPack.VisualStudio.VB6 TaskAction="Build" Projects="@(ProjectsToBuild)"/>    
  </Target>

  <Target Name="EndToEndIteration"
          Condition=" '$(IsDesktopBuild)'!='true' "
          DependsOnTargets="$(EndToEndIterationDependsOn)">
    <CallTarget Targets="Default"/>
    <SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" Status="Succeeded" />
    <OnError ExecuteTargets="OnError"/>
  </Target>

  <Target Name="OnError">
    <SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" Status="Failed" />
  </Target>

</Project>

BuildLog.txt
-------------------------------------------------------------------------------------------------------------------------------------------------
Build started 5/7/2009 2:56:42 PM.
Project "C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj" on node 0 (EndToEndIteration target(s)).
Building with tools version "3.5".
Target "EndToEndIteration" in file "C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj" from project "C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj":
Using "CallTarget" task from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "CallTarget"
Target "Default" in file "C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj" from project "C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj":
Using "MSBuild.ExtensionPack.VisualStudio.TfsSource" task from assembly "C:\Program Files\MSBuild\ExtensionPack\MSBuild.ExtensionPack.dll".
Task "MSBuild.ExtensionPack.VisualStudio.TfsSource"
  Resolve TF.exe path
  TF.exe path resolved to: C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\..\IDE\tf.exe
  TF Operation: Get
  Executing C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\..\IDE\tf.exe get "$/ERP_Easy/Development/0-MAIN/Freedom/Executables/Eagle.exe"  /force /noprompt /recursive
  
C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj(10,5): error : Exit Code 100. Nothing Succeeded: Unable to determine the workspace.
Done executing task "MSBuild.ExtensionPack.VisualStudio.TfsSource" -- FAILED.
Done building target "Default" in project "TFSBuild.proj" -- FAILED.
Done executing task "CallTarget" -- FAILED.
Done building target "EndToEndIteration" in project "TFSBuild.proj" -- FAILED.
Target "OnError" in file "C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj" from project "C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj":
C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj(25,5): error MSB4036: The "SetBuildProperties" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "c:\WINDOWS\Microsoft.NET\Framework\v3.5" directory.
Done building target "OnError" in project "TFSBuild.proj" -- FAILED.
Done Building Project "C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj" (EndToEndIteration target(s)) -- FAILED.

Build FAILED.

"C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj" (EndToEndIteration target) (1) ->
(Default target) -> 
  C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj(10,5): error : Exit Code 100. Nothing Succeeded: Unable to determine the workspace.


"C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj" (EndToEndIteration target) (1) ->
(OnError target) -> 
  C:\Documents and Settings\tfsbuild\Local Settings\Temp\ERP_Easy\FreedomVB6\BuildType\TFSBuild.proj(25,5): error MSB4036: The "SetBuildProperties" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "c:\WINDOWS\Microsoft.NET\Framework\v3.5" directory.

    0 Warning(s)
    2 Error(s)

Time Elapsed 00:00:00.46



Any help, comments or suggestions are greatly appreciated!

Coordinator
May 7, 2009 at 9:28 PM
Hi, is that file your TeamBuild.proj file that you are running in TFS?

A few things,

  1. error : Exit Code 100. Nothing Succeeded: Unable to determine the workspace. Solution: Add the WorkingDirectory property to the TfsSource Get task and set it to a folder that is within the workspace you are trying to work with
  2. error MSB4036: The "SetBuildProperties" task was not found.. Problem: You have no import to <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets" /> so SetBuildProperties will not be available.

I'm not sure why you need the Get task if you are running a team build.

Regards

Mike
May 8, 2009 at 4:57 PM

Mike thanks for the quick response.

 

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets" />

This single line added to my .proj file solved the problem.  Becuase this was not here the build would fail at the "Getting Sources" step of the build.