开发者

msbuild/csproj exec task problem

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 sti开发者_运维技巧ll 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">

  <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


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜