来自TeamCity的MSBuild的/P MSDeploy参数的完整列表 [英] Full list of /P MSDeploy arguments for MSBuild from TeamCity

查看:88
本文介绍了来自TeamCity的MSBuild的/P MSDeploy参数的完整列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在TeamCity中使用MSBuild运行器在本地服务器上进行持续集成,效果很好.但是,我无法以TeamCity期望的格式找到MSDeploy受支持的命令行开关的完整列表.

I currently use the MSBuild runner in TeamCity for continuous integration on my local server and this works very well. However, I'm having trouble finding a full list of supported command line switches for MSDeploy in the format that TeamCity expects them.

此刻,我在参数"部分中使用以下开关:

In my 'Parameters' section at the moment I using the following switches:

  /P:Configuration=OnCommit
  /P:DeployOnBuild=True
  /P:DeployTarget=MSDeployPublish
  /P:MsDeployServiceUrl=https://CIServer:8172/MsDeploy.axd
  /P:AllowUntrustedCertificate=True
  /P:MSDeployPublishMethod=WMSvc
  /P:CreatePackageOnPublish=True
  /P:UserName=Kaine
  /P:Password=**********
  /P:DeployIISAppPath="OnCommit/MySite"
  /P:SkipExtraFilesOnServer=True
  /P:DeployAsIisApp=True

所有这些似乎都可以正常工作,并且MSDeploy可以按预期工作.

All of these seem to work fine and the MSDeploy works as expected.

当我想添加其他参数时,麻烦就来了.

The trouble comes when I want to add additional parameters.

我查看了MSBuild参数和MSDeploy文档,但似乎只找到了以下命令行参数:

I've looked up MSBuild parameters and the MSDeploy documentation and I only seem to find command line parameters like these:

msbuild SlnFolders.sln /t:NotInSolutionfolder:Rebuild;NewFolder\InSolutionFolder:Clean

http://msdn.microsoft.com/en-us/library/ms164311.aspx

这些命令行参数的引用似乎与/P:格式不对应-例如CreatePackageOnPublish和DeployIISAppPath未被识别为命令行参数,但是在TeamCity构建过程中可以正常工作.

It seems that these references for command line arguments don't correspond with the /P: format - for example CreatePackageOnPublish and DeployIISAppPath aren't recognised command line parameters, but they work fine in the TeamCity build process.

在哪里可以找到格式完整的MSDeploy参数的完整列表

Where can I find a full documented list of MSDeploy arguments in the format

/P:Param =值

/P:Param=Value

其他信息:

这里有参数列表:

http://msdn. microsoft.com/en-us/library/microsoft.teamfoundation.build.workflow.activities.msbuild_properties.aspx

但是,这不是一个完整的列表-例如,该列表不包括DeployAsIisApp或SkipExtraFilesOnServer,这两个参数都可以在Team City Build中使用.

However this is not a complete list - for example, this list doesn't include DeployAsIisApp or SkipExtraFilesOnServer, which are both parameters that work from the Team City Build.

此相关问题(可能重复):通过MSBuild进行MSDeploy的有效参数包含一些参数-但仍然没有确定的列表.

Also this related question (possibly duplicate): Valid Parameters for MSDeploy via MSBuild which contains some arguments - but still not a definitive list.

推荐答案

首先,简短的答案是您找不到完整的列表. MSBuild没有可供选择的参数的完整列表,因为您可以发送任何喜欢的参数.这是MSBuild的调用方和MSBuild构建脚本(例如vs vs sln或csproj文件)的作者之间的一种通信方式.

Firstly, the short answer is you can't find the complete list. MSBuild does not have a complete list of parameters you can chose from since you can send any parameter you like. It is a means of communication between the caller of MSBuild and the author of the MSBuild build script (a vs sln or csproj file for instance).

如果构建脚本使用该参数,则将使用该参数,否则它将被忽略.

If the build script use the parameter it is used otherwise it is ignored.

这是对msbuild的有效调用:

So this is a valid call to msbuild:

msbuild /p:<anything>=<anything>

第二,您不应该使用/p:命令选项将参数从teamcity发送到msbuild.而是在teamcity构建配置中设置配置或系统属性.它们将作为参数自动传递给msbuild.

Secondly, you shouldn't send parameters to msbuild from teamcity using the /p: command options. Instead, set configuration or system properties in your teamcity build configuration. They will be passed to msbuild automatically as parameters.

这篇关于来自TeamCity的MSBuild的/P MSDeploy参数的完整列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆