无法从TeamCity部署带有MSBuild的WebDeploy [英] WebDeploy with MSBuild Not Deploying from TeamCity

查看:88
本文介绍了无法从TeamCity部署带有MSBuild的WebDeploy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用MSDeploy使用TeamCity将MVC项目部署到服务器.当我在Powershell的计算机上执行此操作时,请使用以下命令:

I am trying to use MSDeploy to deploy an MVC project to the server using TeamCity. When I do this on my computer in powershell, using the following command:

msbuild.exe .\mvc.csproj /p:PublishProfile=DevServer /p:VisualStudioVersion=11.0
/p:DeployOnBuild=True /p:Password=MyPassword /p:AllowUntrustedCertificate=true

它完美地构建了项目并将其部署到服务器(在DevServer发布配置文件中定义的信息).输出的末尾显示MSDeployPublish部分,其中显示Starting Web deployment task from source...之类的文本,然后显示一些行,告诉我哪些文件已更新,等等.

It builds the project and deploys it to the server (info defined in the DevServer publish profile) perfectly. The output shows an MSDeployPublish section at the end, in which I see text like Starting Web deployment task from source... and then with rows telling me what files are updated, etc.

当我在TeamCity上运行此程序时,使用MSBuild Build步骤,在同一文件上,使用相同的参数(来自相同的工作目录),它会生成项目,但不会发布.相反,它具有构建过程的常规输出(CoreCompile,_CopyFilesMarkedCopyLocal,GetCopyToOutputDirectoryItems,CopyFilesToOutputDirectory),但实际上并没有发布任何内容.

When I run this on TeamCity, using an MSBuild Build step, on the same file, with the same parameters (from the same working directory) it builds the project but does not publish it. Instead it has the regular output from a build process (CoreCompile, _CopyFilesMarkedCopyLocal, GetCopyToOutputDirectoryItems, CopyFilesToOutputDirectory) but then does not actually go and publish anything.

我需要对TeamCity中的设置进行哪些更改,以使其以与在计算机上使用MSBuild的工作方式相同的方式发布部署?

What changes to I need to make to the setup in TeamCity to get it to publish deploy in the same way that it works using MSBuild from my computer?

(TeamCity 7.1,MSBuild 4.0,WebDeploy 3.0,Visual Studio 12,IIS7.与我之前的问题相关)

(TeamCity 7.1, MSBuild 4.0, WebDeploy 3.0, Visual Studio 12, IIS 7. Related to my previous question)

推荐答案

我们使用如下配置的TeamCity MSBuild步骤进行WebDeploys:

We do our WebDeploys with a TeamCity MSBuild step configured as follows:

Build File Path:  Server.csproj

Command Line Parameters:
/p:Configuration=%configuration%
/p:DeployOnBuild=True 
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=https://%web.deploy.server%:8172/MsDeploy.axd
/p:DeployIisAppPath=%web.deploy.site% 
/p:AllowUntrustedCertificate=True
/p:Username=
/p:AuthType=NTLM

我们使用集成身份验证;根据需要进行更改以适合您的方案.我认为,这样做的价值在于它可以从头开始构建所有内容,并且不依赖于预先构建的程序包.从您发布的要旨中,我注意到您进行了一些数据库发布,我们没有为此使用WebDeploy,因此我无法在此处提供任何指导.希望这会有所帮助.

We use integrated authentication; change as necessary to fit your scheme. The value of this, I think, is that it builds everything from scratch and doesn't rely on a pre-built package. From the gist you posted I noticed that you do some DB publishing, we don't use WebDeploy for that so I can't offer any guidance there. Hope this helps.

这篇关于无法从TeamCity部署带有MSBuild的WebDeploy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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