Reputation: 3184
I have the following for command line parameters. This is the team city build step. I need to exclude web.config and robots.txt.
/p:DeployOnBuild=True
/p:PublishProfile=OffCycleDevelopmentRemoteDeployment
/p:ProfileTransformWebConfigEnabled=False
/p:VisualStudioVersion=12.0
/p:ExcludeFilesFromDeployment=Web.config;robots.txt
My build is failing when i try to "Run" the project.
[15:34:30]Step 1/1: Visual Studio Build and Publish (Visual Studio (sln)) (1s)
[15:34:30][Step 1/1] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\McoMobile-OffCycle "/msbuildPath:C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe"
[15:34:30][Step 1/1] in directory: C:\TeamCity\buildAgent\work\McoMobile-OffCycle
[15:34:31][Step 1/1] MSBuild command line parameters contain "/property:" or "/p:". It is recommended to define System Property on Build Parameters instead.
[15:34:31][Step 1/1] Process exited with code 1
[15:34:31][Step 1/1] MSBuild output
[15:34:31]Start MSBuild...
[15:34:31]'C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe' '"@C:\TeamCity\buildAgent\work\Mobile-OffCycle\Mobile.sln.teamcity.msbuild.tcargs" "C:\TeamCity\buildAgent\work\Mobile-OffCycle\Mobile.sln.teamcity"'
[15:34:31]working dir = 'C:\TeamCity\buildAgent\work\Mobile-OffCycle'
[15:34:31]Microsoft (R) Build Engine version 12.0.30723.0
[15:34:31][Microsoft .NET Framework, version 4.0.30319.18408]
[15:34:31]Copyright (C) Microsoft Corporation. All rights reserved.
[15:34:31]
[15:34:31]MSBUILD : error MSB1006: Property is not valid.
[15:34:31]Switch: robots.txt
[15:34:31]
[15:34:31]For switch syntax, type "MSBuild /help"
[15:34:31][Step 1/1] Step Visual Studio Build and Publish (Visual Studio (sln)) failed
If i keep only one file then no error occurs.
/p:ExcludeFilesFromDeployment=Web.config
How can i specify multiple files here?
I tried following but this is posts my files to the web site.
/p:ExcludeFilesFromDeployment=Web.config
/p:ExcludeFilesFromDeployment=robots.txt
Upvotes: 0
Views: 1532
Reputation: 3454
You need to quote property value, e.g. /p:ExcludeFilesFromDeployment="Web.config;robots.txt"
Also see this question if you need to convert your property value into item list
I'm not sure where have you found property ExcludeFilesFromDeployment, but I assume it's working one and there is a MSBuild target to handle expected behaviour.
Upvotes: 2