9

I am trying to run MSBuild with TeamCity.

I have a batch file and I pass into it parameters and the build works. When I try to run through TeamCity I get the error below

[13:24:46][MSBuild output] Start MSBuild...

[13:24:46][MSBuild output] 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe' 
'"@C:\TeamCity\buildAgent\work\999585556854a516\Build\Default.msbuild.teamcity.msbuild.tcargs" C:\TeamCity\buildAgent\work\999585556854a516\Build\Default.msbuild.teamcity'

[13:24:46][MSBuild output] working dir = 'C:\TeamCity\buildAgent\work\999585556854a516'

[13:24:46][MSBuild output] Microsoft (R) Build Engine Version 4.0.30319.1

[13:24:46][MSBuild output] [Microsoft .NET Framework, Version 4.0.30319.296]

[13:24:46][MSBuild output] Copyright (C) Microsoft Corporation 2007. All rights reserved.

[13:24:46][MSBuild output]

[13:24:46][MSBuild output] MSBUILD : error MSB1008: Only one project can be specified.

[13:24:46][MSBuild output] Switch: C:\TeamCity\buildAgent\work\999585556854a516\Build\Default.msbuild.teamcity

[13:24:46][MSBuild output]

[13:24:46][MSBuild output] For switch syntax, type "MSBuild /help"

In TeamCity my command line parameters field looks like Configuration=Debug;DeployPath=E:\websites\umbraco\mysite;Environment=Dev;

I did search on StackOverflow and people having similar issues mention ensuring no spaces in commandline parameters also my sln and proj files / pages do not have spaces.

As I said when I run a batch file with those parameters it all works, however, TeamCity fails.

sigod
  • 2,211
  • 2
  • 20
  • 38
Ismail
  • 601
  • 1
  • 6
  • 23

1 Answers1

12

I managed to reproduce the error in the command line: apparently the file contents for Default.msbuild.teamcity.msbuild.tcargs need to be:

/p:Configuration=Debug;DeployPath=E:\websites\umbraco\mysite;Environment=Dev;

instead of:

Configuration=Debug;DeployPath=E:\websites\umbraco\mysite;Environment=Dev;
Pedro Pombeiro
  • 1,544
  • 12
  • 14
  • Pedro, many thanks for you reply all sorted I had to take of the last semi colon. I have been struggling with for days. – Ismail Jun 09 '13 at 08:45
  • I haven't found this as a file, but I just changed the command line arguments in MsBuild build step, and it worked... – veljkoz Jan 03 '14 at 12:53
  • @Pedro Pombeiro: I tried `MSBuild.exe C:\BuildAgent\work\4c7b8ac8bc7d723e\WebService.sln /p:Configuration=Release /p:OutputPath=bin /p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MsDeployServiceUrl=https://204.158.674.5/msdeploy.axd /p:username=Admin /p:password=Password#321 /p:AllowUntrustedCertificate=True /p:DeployIisAppPath=Default WebSite/New /p:MSDeployPublishMethod=WMSVC`. It gives me an error `MSBUILD : error MSB1008: Only one project can be specified. Switch: WebSite/New`. What might be the issue? – Nevin Raj Victor May 27 '15 at 14:59
  • @NevinRaj: Can you try adding commas around the parameter value? (i.e. `/p:DeployIisAppPath="Default WebSite/New"`) – Pedro Pombeiro May 28 '15 at 16:23