tags:

views:

48

answers:

1

I am having a problem on my build server(2003) with msbuild. I have narrowed down the issue to the exec task in the csproj file,which I have extracted into a very simple csproj(below), and still no joy, see the 'C:\Documents' error. This all works with no problems on my local machine.

I think there is some issue with an environment variable, but I cant figure it. Any advice?

Input


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;

  <Target Name="BeforeBuild">
   <Exec Command="echo hello world" />
  </Target>

</Project>

MSBuild output

 D:\cc.net working\source\WebBase>msbuild ExecIssue.csproj
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 11/10/2010 12:37:50.
Project "D:\cc.net working\source\WebBase\ExecIssue.csproj" on node 1 (default t
argets).
BeforeBuild:
  echo hello world



'C:\Documents' is not recognized as an internal or external command,
  operable program or batch file.



D:\cc.net working\source\WebBase\ExecIssue.csproj(5,4): error MSB3073: The comma
nd "echo hello world" exited with code 1.
Done Building Project "D:\cc.net working\source\WebBase\ExecIssue.csproj" (defau
lt targets) -- FAILED.


Build FAILED.

"D:\cc.net working\source\WebBase\ExecIssue.csproj" (default target) (1) ->
(BeforeBuild target) ->
  D:\cc.net working\source\WebBase\ExecIssue.csproj(5,4): error MSB3073: The com
mand "echo hello world" exited with code 1.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.17

A: 

I would run it in diagnostic mode and send it to a file and then search for C:\Documents in the file. Maybe it's using "C:\Documents and settings\" in some path parameter without quoting it. The diagnostic mode will print out most if not all of the properties, item groups, environment variables, etc that are in use. Hopefully it will print out all the properties being used by the exec task, since you are only supplying the command parameter it is using some defaults for the rest of them.

msbuild ExecIssue.csproj /v:Diagnostic > buildout.txt
Ted Elliott
@ted this was useful to see the paths, thanks for tip, but sadly no joy. cant see any obvious difference between the broken build, and the one on the local machine.@alli'm going to put it down as a server issue, and reinstall the machine at this stage, as nothing obvious seems to be poping out from this. thanks for all the help guys
jasper