TFS2010 Team build - how to deploy databases before running unit tests - database-deployment

I followed How to prepare database for TFS deployment walkthrough
and my build script successfully deploys the database at the end of the build process. However, I need the database to be deployed before running unit tests.
I tried copying the step and pasting it right above "Get Impacted Tests, Index Sources and Publish Symbols". However, the build process returns the following error:
* The deployment manifest file Database_Core.deploymanifest does not exist
Here is the excerpt from my xaml file for the database deploy:
<Sequence DisplayName="Deploy Database" sap:VirtualizedContainerService.HintSize="486,330">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsPinned">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<If Condition="[BuildDetail.CompilationStatus <> BuildPhaseStatus.Failed]" DisplayName="If Build Succeeded" sap:VirtualizedContainerService.HintSize="464,206">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsPinned">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<If.Then>
<mtbwa:InvokeProcess Arguments="["/a:Deploy /cs:""Data Source=MyServer-SQL1\BUILD;Integrated Security=True;Pooling=False"" /dd+ /dsp:Sql /manifest:Database_Core.deploymanifest"]" DisplayName="Invoke VSDBCMD" FileName="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Deploy\VSDBCMD.EXE" sap:VirtualizedContainerService.HintSize="219,100" WorkingDirectory="[BuildDetail.DropLocation]">
<mtbwa:InvokeProcess.ErrorDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="errOutput" />
</ActivityAction.Argument>
<mtbwa:WriteBuildError DisplayName="VSDBCMD Error" sap:VirtualizedContainerService.HintSize="200,22" Message="[errOutput]" />
</ActivityAction>
</mtbwa:InvokeProcess.ErrorDataReceived>
<mtbwa:InvokeProcess.OutputDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="stdOutput" />
</ActivityAction.Argument>
<mtbwa:WriteBuildMessage DisplayName="VSDBCMD Output" sap:VirtualizedContainerService.HintSize="200,22" Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High]" Message="[stdOutput]" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" />
</ActivityAction>
</mtbwa:InvokeProcess.OutputDataReceived>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</mtbwa:InvokeProcess>
</If.Then>
<If.Else>
<mtbwa:WriteBuildWarning DisplayName="Deployment Skipped" sap:VirtualizedContainerService.HintSize="220,100" Message="Database deployment was skipped" />
</If.Else>
</If>
</Sequence>

This is exactly what I needed as well. Please see here a PNG that depicts all points that follow:
At first I arranged a set of Arguments in my build process template, where I set the target Database host, the user & the password. (See "Argument" section)
In case the current Project's Unit tests need a running DB, I set in "Items to build" 2 different projects:
In the first slot the *.dbproj
In the second the SLN itself
Now within the Build process template I 've expanded the "Run MSBuild for project" as a Sequence (See "Sequence"), ensuring that that the MSBuild Arguments are different in the left case :
Arguments for MSBuild on the left side ("Run MSBuild + Deploy DB"):
String.Format("/p:SkipInvalidConfigurations=true /t:Build;Deploy /p:TargetConnectionString=""Data Source={0}%3Buser={1}%3Bpwd={2}"" /p:DeployToDatabase=true /p:TargetDatabase={3}_{4} {5}",
TargetMachineToDeployDB, DBUsername, DBPassword, DBName, BuildDetail.BuildNumber.Replace(".", "_"), MSBuildArguments)
In case it's not too obvious, the connection between the Arguments & the displayed params in the Definition are:
- TargetMachineToDeployDB = "PC name where Database shall be deployed"
- DBUsername = "Database Username"
- DBPassword = "Database Password"
- DBName = "Database Prefix Name" (I concat the current buildname)
Arguments for MSBuild on the right side ("Run MSBuid for SLN/Project"):
String.Format("/p:SkipInvalidConfigurations=true {0}", MSBuildArguments)
Note that if I deployed a DB on the left side, I will also set a DBHasBeenSet into TRUE, which will also trigger some file handling inside "Adaptations in Source Files". These include redirecting our NUnit DLLs to the newly constructed DB. I can set more details on that, if you 'd like.

You can change where this happens in your deployment.
I would deploy the database right after your main build command in the workflow. In 2008 with the .proj this a little more clear because you would simply add it to <Target Name=BeforeTest> Try moving it to an earlier point in the process.

Related

Workflow Designer encountered problems with your document

I found out that the problem is this part : this:_a650.argument1="this is a test" Does anyone know what does this expression in XAML file mean within Activity tag?
If I take this out this:_a650.argument1="this is a test"
then I can open the workflow file in a workflow designer with no problem, but when it is there I get the follwoing error message: Workflow Designer encountered problems with your document
Please check the document for invalid content,namespace, references or reference loops.
could not find member argument1 in type _a650
Any ideas?
<Activity mc:Ignorable="sap sads" x:Class="{x:Null}" this:_a650.argument1="this is a test"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:s1="clr-namespace:System;assembly=System"
xmlns:s2="clr-namespace:System;assembly=System.Core"
xmlns:s3="clr-namespace:System;assembly=System.ServiceModel"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:this="clr-namespace:"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<x:Members>
<x:Property Name="argument1" Type="InArgument(x:String)" />
</x:Members>
<sap:VirtualizedContainerService.HintSize>526.4,369.6</sap:VirtualizedContainerService.HintSize>
<mva:VisualBasic.Settings>Assembly references and imported namespaces for internal implementation</mva:VisualBasic.Settings>
<Sequence sap:VirtualizedContainerService.HintSize="486.4,329.6">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<If Condition="[2 = 2]" sap:VirtualizedContainerService.HintSize="464,204.8" />
</Sequence>
</Activity>
Change the x:Class={x:Null} attribute to _a650. XAML should open fine then.
<Activity mc:Ignorable="sap" x:Class="_a650" this:_a650.argument1="this is a test" ... >
The expression this:_a650.argument1="this is a test" together with the Property definition inside Members declare an IN argument of type String (with "this is a test" as its default value) belonging to a _a650 type.
<x:Property Name="argument1" Type="InArgument(x:String)" />
The answer to this question is related to one of your other questions Visual Studio 2010 - Workflow Designer encountered problems on SO. Since, the arguments have to be declared as members of a type but the "root" activity has not been named to derive the type from; a random type name (like _a650) is generated and used.
The "root" activity name, however, is not updated and so upon XAML serialization x:Class is still generated as {x:Null}. This results in a namespace error when this same XAML is opened in Workflow Designer as the XAML parser is unable to find any x:Class declared to be of _a650 type.

WiX 'Bundle' 'ExePackage' 'DetectCondition' is always false

I am trying to create a WiX bundle that installs the .NET Framework 4.0 before my MSI installer. I inspected the log file for my bootstrapper using the command line argument \l log.txt and discovered that the ExePackage::DetectCondition is always evaluating to false.
I am including WixNetFxExtension.dll as a reference in my Visual Studio 2010 Windows Installer XML Bootstrapper project.
I am including the NetFxExtension namespace:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
Providing the basic bundle framework:
<Bundle Name="RSA Bootstrapper"
...
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
...
<Chain>
<PackageGroupRef Id="NET40" />
<PackageGroupRef Id="RSA_Application" />
</Chain>
</Bundle>
...
I am including the <PropertyRef Id="NETFRAMEWORK40FULL" /> in the fragment and then going on to define the ExePackage for .NET Framework 4.0 (NET40):
<Fragment>
<PropertyRef Id="NETFRAMEWORK40FULL" />
<PackageGroup Id="NET40">
<ExePackage SourceFile="dotNetFx40_Full_x86_x64.exe"
Compressed="yes"
Cache="yes"
DetectCondition="NETFRAMEWORK40FULL"
InstallCommand="/norestart /passive /showrmui /ACTION=Install"
Permanent="yes"
InstallCondition="NOT NETFRAMEWORK40FULL"
Vital="yes" >
<ExitCode Value="0" Behavior="success" />
<ExitCode Value="1641" Behavior="scheduleReboot" />
<ExitCode Value="3010" Behavior="scheduleReboot" />
<ExitCode Behavior="error" /> <!-- Everything else is an error -->
</ExePackage>
...
I have also checked the Visual Studio build output to confirm that the WixNetFxExtension.dll is referenced correctly:
C:\Program Files (x86)\WiX Toolset v3.7\bin\Light.exe ... -ext "C:\Program Files (x86)\WiX Toolset v3.7\bin\WixNetFxExtension.dll"
The problem is with the DetectCondition property. No matter what I set it to, it evaluates to false.
Thinking that maybe the NETFRAMEWORK40FULL reference cannot be trusted, I tried using this instead:
<Fragment>
<Variable Name="isInstalled"
Type="numeric"
Value="0"
Persisted="yes"
bal:Overridable="yes"/>
<util:RegistrySearch Id="FindInstallKey"
Root="HKLM" Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
Value="Install"
Result="exists"
Variable="InstallKeyExists" />
<util:RegistrySearch
Root="HKLM" Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
Value="Install"
Variable="isInstalled"
After="FindInstallKey"
Condition="InstallKeyExists = true"
Format="raw" />
</Fragment>
Setting DetectCondition="isInstalled" or DetectCondition="isInstalled = true" always evaluates to false. Even setting DetectCondition="true" always evaluates to false!
Here is a log snippet of what I am talking about, with DetectCondition="true"
[16A0:17B4][2013-02-13T13:01:43]i001: Burn v3.7.1224.0, Windows v6.1 (Build 7601: Service Pack 1), path: C:\Users\lalic\Documents\Visual Studio 2010\Projects\RSA Preset\Bootstrapper\bin\Release\Bootstrapper.exe, cmdline: '/l log.txt -burn.unelevated BurnPipe.{33090847-CC78-445B-BAAA-564B840B7E8E} {38F95C6A-EC0F-4402-951B-FABFC5827CB6} 6296'
[16A0:17B4][2013-02-13T13:01:43]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\lalic\Documents\Visual Studio 2010\Projects\RSA Preset\Bootstrapper\bin\Release\log.txt'
[16A0:17B4][2013-02-13T13:01:43]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\lalic\Documents\Visual Studio 2010\Projects\RSA Preset\Bootstrapper\bin\Release\Bootstrapper.exe'
[16A0:17B4][2013-02-13T13:01:43]i052: Condition '((VersionNT = v5.1) AND (ServicePackLevel >= 3)) OR ((VersionNT = v5.2) AND (ServicePackLevel >= 2)) OR ((VersionNT = v6.0) AND (ServicePackLevel >= 1)) OR (VersionNT >= v6.1)' evaluates to true.
[16A0:17B4][2013-02-13T13:01:43]i000: Setting string variable 'WixBundleName' to value 'RSA Bootstrapper'
[16A0:17B4][2013-02-13T13:01:43]i100: Detect begin, 2 packages
[16A0:17B4][2013-02-13T13:01:43]i052: Condition 'true' evaluates to false.
[16A0:17B4][2013-02-13T13:01:43]i103: Detected related package: {D431417D-F0AC-4CFB-8E25-E27F5B8101D9}, scope: PerMachine, version: 2.1.15.0, language: 0 operation: MajorUpgrade
[16A0:17B4][2013-02-13T13:01:43]i101: Detected package: dotNetFx40_Full_x86_x64.exe, state: Absent, cached: None
[16A0:17B4][2013-02-13T13:01:43]i101: Detected package: RSA_Preset.msi, state: Absent, cached: None
[16A0:17B4][2013-02-13T13:01:43]i199: Detect complete, result: 0x0
[16A0:17B4][2013-02-13T13:02:04]i200: Plan begin, 2 packages, action: Install
[16A0:17B4][2013-02-13T13:02:04]i052: Condition 'NOT NETFRAMEWORK40FULL' evaluates to true.
Specifically,
i052: Condition 'true' evaluates to false.
and actually Condition 'NOT NETFRAMEWORK40FULL' evaluates to true. even though I have .NET 4.0 Full installed and can manually find the .NET 4.0 entry in my registry, both in the usual spot and under HKLM\SOFTWARE\Wow6432Node (I am on a 64 bit system).
Am I missing something? Why doesn't DetectCondition work for me? The project compiles, runs, deploys the payload(s) and otherwise works fine.
<PropertyRef Id="NETFRAMEWORK40FULL" /> is a reference to an MSI property but you're creating a bundle. Bundles have variables that are distinct from MSI properties, though Burn itself provides a number of bundle variables that mimic those that MSI provides.
That said, WixNetFxExtension provides package groups for the 4.0 NetFx installers. You can replace all that with a simple <PackageGroupRef Id="NetFx40Redist" />.
Variables like NETFRAMEWORK40FULL are MSI variables, you cannot use them in Bundles.
I have successfully embedded the .NET Framework 4.0 Client Version within my bundle. Conditions variables resolved from the Registry.
Notice the syntax "<<" (which translates to <<) in DetectCondition attribute. This page may help http://wix.tramontana.co.hu/tutorial/com-expression-syntax-miscellanea/expression-syntax
<?xml version="1.0" encoding="UTF-8"?>
<Wix
xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Bundle
Name="My Program Name"
Version="1.2.0"
Manufacturer="SUSU"
UpgradeCode="some-guid">
<Chain>
<PackageGroupRef Id="Netfx4"/>
<MsiPackage Id="MyProgramInstaller" SourceFile="product.msi" Compressed="yes"/>
</Chain>
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication
LicenseFile="license.rtf"
ShowVersion="yes"
/>
</BootstrapperApplicationRef>
</Bundle>
<Fragment>
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Client" Value="Version"
Variable="Netfx4ClientVersion" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Client" Value="Version"
Variable="Netfx4x64ClientVersion" Win64="yes" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version"
Variable="Netfx4FullVersion" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version"
Variable="Netfx4x64FullVersion" Win64="yes"/>
<PackageGroup Id="Netfx4">
<ExePackage
Id="Netfx4"
Cache="no"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="c:\Downloads\dotNetFx40_Client_x86_x64.exe"
InstallCommand="/q"
DetectCondition="(Netfx4FullVersion << "4") OR (Netfx4ClientVersion << "4") OR (Netfx4x64ClientVersion << "4") OR (Netfx4x64FullVersion << "4")"
/>
</PackageGroup>
</Fragment>
</Wix>

CCNet Scheduled build only if another project successfully built

I'm trying to get CCNet to build a project at a scheduled time, but ONLY if another project successfully built since the last time. I have the following block:
<triggers>
<multiTrigger operator="And">
<triggers>
<projectTrigger project="Trunk Integration Tests">
<triggerStatus>Success</triggerStatus>
<innerTrigger type="intervalTrigger" seconds="30" buildCondition="IfModificationsExist" />
</projectTrigger>
<scheduleTrigger time="15:00" buildCondition="ForceBuild" name="Scheduled" />
</triggers>
</multiTrigger>
</triggers>
To head off any questions about why I want to do this; we have integration tests that run once an hour. The build from which the above code comes is a deployment build that pulls down the code, compiles, and the pushes the code out to one of our servers. We have deployment builds for dev servers, QA and staging.
The problem I'm having is that this build fired at 4:45PM yesterday, just after the integration build was successful. CCNet says the build reason was Build (ForceBuild) triggered from Scheduled.
What's going on here, and how can I get it working like I described?
I think it's possible to avoid <multiTrigger> in this case. You can just author a <projectTrigger>, and set its <innerTrigger> to the type of <scheduleTrigger>. Something like this:
<triggers>
<projectTrigger project="Trunk Integration Tests">
<triggerStatus>Success</triggerStatus>
<innerTrigger type="scheduleTrigger" time="15:00" buildCondition="IfModificationsExist" name="Scheduled" />
</projectTrigger>
</triggers>
I use triggerFirstTime true to fire with a schedule interval.
<projectTrigger project="MyProject">
<triggerStatus>Success</triggerStatus>
<triggerFirstTime>true</triggerFirstTime>
<innerTrigger type="scheduleTrigger" time="10:30" buildCondition="ForceBuild" name="Scheduled" />
</projectTrigger>

VSTO install package How to check for prerequisites and skip them

I created Setup project for my Excel add-in project according to the article:
Deploying a Visual Studio Tools for the Office System 3.0 Solution for the 2007 Microsoft Office System Using Windows Installer
http://msdn.microsoft.com/en-us/library/cc563937(office.12).aspx
I add prerequisites such as 2007 Interop assemblies(Office2007PIA) and when
I run my setup file it does install it.
But the problem is :
That my setup ALWAYS installs it even if my computer already has
Office2007PIA.
How can I configure my setup project that it will first check if
Office2007PIA is installed and continue the installation of my project
without installing Office2007PIA?
Here is the code from "c:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Office2007PIA\en\package.xml":
<Package
xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
Name="DisplayName"
Culture="Culture"
>
<!-- Defines a localizable string table for error messages. -->
<Strings>
<String Name="DisplayName">2007 Microsoft Office Primary Interop Assemblies</String>
<String Name="Culture">en</String>
<String Name="AdminRequired">Administrator permissions are required to install the 2007 Microsoft Office Primary Interop Assemblies. Contact your administrator.</String>
<String Name="GeneralFailure">A failure occurred attempting to install Microsoft Office 2003 primary interop assemblies.</String>
</Strings>
</Package>
And here is the code from
"c:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Office2007PIA\en\package.xml" "c:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Office2007PIA\product.xml":
<Product
xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
ProductCode="Microsoft.Office.PIA.2007"
>
<RelatedProducts>
<DependsOnProduct Code="Microsoft.Net.Framework.2.0" />
</RelatedProducts>
<!-- Defines the list of files to be copied on build. -->
<PackageFiles>
<PackageFile Name="o2007pia.msi"/>
<PackageFile Name="ComponentCheck.exe"/>
</PackageFiles>
<InstallChecks>
<ExternalCheck
Property="Office2007Exists"
PackageFile="ComponentCheck.exe"
Arguments="{0638C49D-BB8B-4CD1-B191-050E8F325736}"/>
</InstallChecks>
<!-- Defines how to run the Setup package. -->
<Commands Reboot="Defer">
<Command PackageFile="o2007pia.msi"
Arguments=""
EstimatedInstalledBytes="30000000"
EstimatedInstallSeconds="60"
>
<InstallConditions>
<BypassIf Property="Office2007Exists" Compare="ValueNotEqualTo" Value="0" />
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="1641" Result="SuccessReboot"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
</ExitCodes>
</Command>
</Commands>
</Product>
I suppose you mean product.xml is missing code (in node InstallConditions):
<BypassIf Property="PIAInstallAction" Compare="ValueNotEqualTo" Value="0" />
?
My guess is that the installation is not done with administrative permissions as this is a requirement when installing assemblies to the GAC.
If you want to dig deeper you can analyze the process how the PIA installation is triggered:
Whether the Office PIA are installed is determined by a small executable included in the setup bootstrapper that checks if the PIA are actually present on disc.
The executable is named ComponentCheck.exe and is typically located under
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Office2007PIARedist
I suggest you run this program and check with Process Monitor whether anything fails. Based on the exit code of ComponentCheck.exe the installation of the PIAs is triggered or not.
This exit code condition is specified in the file package.xml in the same folder:
<InstallConditions>
<BypassIf Property="PIAInstallAction" Compare="ValueNotEqualTo" Value="0" />
<!-- Requires the user to be an admin user when installing the prerequisite -->
<FailIf Property="AdminUser" Compare="ValueEqualTo"
Value="false" String="AdminRequired" />
</InstallConditions>

NAnt/NAntContrib 'VB6' failed to start on remote build

Background
I'm putting together a Continuous Integration system at work on two VMs running on my local desktop. VM #1 (Toolbox) is running CruiseControl.Net, Subversion, BugTracker.Net and SQL Server Express. VM #2 (BuildMaster) is running NAnt with NAntContrib and has VB 6.0 and the 1.0/1.1/2.0/3.5 .Net Framework SDKs installed. The intent is to tightly control what's installed on BuildMaster and be much looser on Toolbox and developer workstations.
Issue
I had a CCNet project on Toolbox that successfully compiled a test VB 6.0 application on BuildMaster, but the build started failing last week. The only thing I remember doing was install BugTracker.Net and SQL Server Express on Toolbox.
Symptoms
The build fails and returns an exception:
<![CDATA[Starting 'vb6 ( /make "\\buildmaster\Working\TestApp\TestApp.vbp" /outdir "\\buildmaster\Working\TestApp\build" /out "\\buildmaster\Working\TestApp\TestApp.build.err")' in '\\buildmaster\Working\TestApp']]></message><duration>711.02240000000006</duration></task><duration>761.09440000000006</duration></target><failure><builderror><type>NAnt.Core.BuildException</type><message><![CDATA['vb6' failed to start.]]></message><location><filename>\\buildmaster\Working\TestApp\TestApp.build</filename><linenumber>39</linenumber><columnnumber>4</columnnumber></location><stacktrace><![CDATA[ at NAnt.Core.Tasks.ExternalProgramBase.StartProcess() in c:\Nant\src\NAnt.Core\Tasks\ExternalProgramBase.cs:line 501
at NAnt.Core.Tasks.ExternalProgramBase.ExecuteTask() in c:\Nant\src\NAnt.Core\Tasks\ExternalProgramBase.cs:line 386
at NAnt.Contrib.Tasks.Vb6Task.ExecuteTask() in c:\Nant\contrib\src\Tasks\Vb6Task.cs:line 220
at NAnt.Core.Task.Execute() in c:\Nant\src\NAnt.Core\Task.cs:line 186
at NAnt.Core.Target.Execute() in c:\Nant\src\NAnt.Core\Target.cs:line 247
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies) in c:\Nant\src\NAnt.Core\Project.cs:line 910
at NAnt.Core.Project.Execute() in c:\Nant\src\NAnt.Core\Project.cs:line 862
at NAnt.Core.Project.Run() in c:\Nant\src\NAnt.Core\Project.cs:line 947]]></stacktrace><internalerror><type>System.ComponentModel.Win32Exception</type><message><![CDATA[The system cannot find the file specified]]></message><stacktrace><![CDATA[ at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at NAnt.Core.Tasks.ExternalProgramBase.StartProcess() in c:\Nant\src\NAnt.Core\Tasks\ExternalProgramBase.cs:line 498]]></stacktrace></internalerror></builderror></failure><duration>1211.7424</duration></buildresults>
Obviously, the meat of the exception is [CDATA['vb6' failed to start.]]. My problem is that when I run the Nant build directly on BuildMaster it completes the build successfully every time.
For the sake of completeness, here's my NAnt build script:
<?xml version="1.0" ?>
<project name="TestApp" default="build">
<!-- set build.date property to current date in format yyyy-MM-dd -->
<tstamp property="build.date" pattern="yyyy-MM-dd" />
<!-- global project settings -->
<property name="project.name" value="TestApp" />
<property name="project.version" value="1.00" unless="${property::exists('project.version')}" />
<property name="project.release.type" value="release" unless="${property::exists('project.release.type')}" /> <!-- nightly / dev / alpha / beta# / rc# / release -->
<property name="build.warnaserror" value="false" />
<!-- default configuration -->
<property name="project.client" value="" />
<property name="build.defines" value="" />
<property name="build.number" value="${math::abs(math::floor(timespan::get-total-days(datetime::now() - datetime::parse('01/01/2000'))))}" />
<!-- platform specific properties. These are the defaults -->
<property name="current.build.defines" value="${build.defines}" />
<!-- Build Tasks -->
<target name="init" description="Initializes build properties">
<property name="build.dir" value="${project::get-base-directory()}\build" />
<echo message="Build Directory is ${build.dir}" />
</target>
<target name="clean" depends="init" description="Deletes current build configuration">
<echo message="Clearing out files before recompiling..." />
<delete verbose="true">
<fileset basedir="${build.dir}">
<include name="TestApp*.exe" />
</fileset>
</delete>
</target>
<target name="build" depends="clean" description="Perform a build of the base TestApp product">
<mkdir dir="${build.dir}" unless="${directory::exists(build.dir)}" />
<!-- Actually compile VB6 project into executable -->
<vb6 project="TestApp.vbp" outdir="${build.dir}" errorfile="TestApp.build.err" verbose="true" />
</target>
</project>
Your help is greatly appreciated!
I might be misinterpreting your question so please bear with me. CCNet's nant task operatates on the local machine (the machine running CCNet).
If ToolBox is running CCNet but BuildMaster is running all tools (i.e. VB6, etc), I'm fairly sure there no way to do what's being attempted. Generally, CCNet needs to be running on the machine actually performing the builds. Therefore, the fact that VB6 cannot be found is because VB6 is not installed on ToolBox.
However, CCNet does have a way to monitor/control multiple build servers from one. So in your case you could configure ToolBox to control BuildMaster's builds, but CCNet would need to be installed on both. For a reference on something like this you can check out Splitting the build on CCNet's site.

Resources