This is my first dive into MSBuild so I'm feeling pretty lost.
The end goal is to run an executable which will output a file, and we want the output of the build to be that file. In this build there is no VS project what so ever.
The build is being run by TFS build services.
At this point all I'm trying to do is generate a file and have it copied to the drop folder.
Here is the contents of my .proj file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Build">
<Message Text="Output Dir: $(OutDir)" />
<MakeDir Directories="$(OutDir)" />
<Exec Command='dir /s > \\ANetworkPath\dir.txt
dir /s > $(OutDir)Dir2.txt'/>
</Target>
</Project>
The first command of writing dir to the network path succeeds, however it doesn't show the existence of $(OutDir). So I thought I would try to create it with MakeDir. When the second dir command executes it errors because the path doesn't exist.
TFS is running MSBuild with the following command
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /noconsolelogger "C:\Builds\1\Scratch\Test Build\Sources\user\Test\Build.proj" /m:1 /fl /p:SkipInvalidConfigurations=true /p:OutDir="C:\Builds\1\Scratch\Test Build\Binaries\\" /p:VCBuildOverride="C:\Builds\1\Scratch\Test Build\Sources\user\Test\Build.proj.vsprops" /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/111;InformationNodeId=6570;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://tfshost:8080/tfs/Test%20Collection;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;"
The only output is in the file written on the network:
Directory of C:\Builds\1\Scratch\Test Build\Sources\user\Test
09/17/2010 10:53 AM <DIR> .
09/17/2010 10:53 AM <DIR> ..
09/17/2010 10:53 AM <DIR> A Directory
09/17/2010 10:53 AM 0 Test.log
09/17/2010 10:53 AM 453 Test.proj
09/17/2010 10:53 AM 201 Test.proj.vsprops
3 File(s) 654 bytes
Directory of C:\Builds\1\Scratch\Test Build\Sources\user\Test\A Directory
09/17/2010 10:53 AM <DIR> .
09/17/2010 10:53 AM <DIR> ..
09/17/2010 10:53 AM 9 A File.txt
09/17/2010 10:53 AM 15 Another File.txt
2 File(s) 24 bytes
Total Files Listed:
5 File(s) 678 bytes
5 Dir(s) 40,243,372,032 bytes free
Here is the build log:
Build started 9/17/2010 12:05:29 PM.
Project "C:\Builds\1\Scratch\Test Build\Sources\user\Test\Test.proj" on node 1 (default targets).
Build:
Output Dir: C:\Builds\1\Scratch\Test Build\Binaries\
dir /s > C:\Builds\1\Scratch\Test Build\Binaries\Dir2.txt
The system cannot find the path specified.
C:\Builds\1\Scratch\Test Build\Sources\user\Test\Test.proj(24,3): error MSB3073: The command "dir /s > C:\Builds\1\Scratch\Test Build\Binaries\Dir2.txt" exited with code 1.
Done Building Project "C:\Builds\1\Scratch\Test Build\Sources\user\Test\Test.proj" (default targets) -- FAILED.
Build FAILED.
"C:\Builds\1\Scratch\Test Build\Sources\user\Test\Test.proj" (default target) (1) ->
(Build target) ->
C:\Builds\1\Scratch\Test Build\Sources\user\Test\Test.proj(24,3): error MSB3073: The command "dir /s > C:\Builds\1\Scratch\Test Build\Binaries\Dir2.txt" exited with code 1.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.14
Am I going about this completely wrong?