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

查看:22
本文介绍了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;NewFolderInSolutionFolder: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=值

其他信息:

这里有一个参数列表:

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 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天全站免登陆