开发者

How can I use MSBuild to deploy to a folder in TeamCity?

On my local dev machine this works perfectly:

msbuild project.name.csproj /p:DeployOnBuild=true /p:DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="c:\proyectos\folder1\deploy" /p:AutoParameterizationWebConfigConnectionStrings=false

I'm trying to configure a Build step in TeamCity with MSBuild, in the "Command line parameters" I'm putting this:

/p:DeployOnBuild=true /p:DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="c:\proyectos\folder1\deploy" /p:AutoParameterizationWebC开发者_运维问答onfigConnectionStrings=false

It runs, no errors are displayed, but files are not copied to "c:\proyectos\folder1\deploy"

Edit: I'm having the same issues with MSBuild on the command prompt, so it's not teamcity. My local dev machine is on windows 7 and the server is windows 2003


Run with /v:d or v:diag to get logging.

(Get it working local first but... In TeamCity, view the agent in the console and look at the agent detail logs for similar such logs (or just pass the same /v: flag to MSBuild via TeamCity))


You'll want to ensure that the user running the "TeamCity Build Agent Service" has write access to the relevant directories.

(FWIW, I believe the LocalSystem account has different group memberships in Server 2003 and Windows 7. We run all of our TeamCity build agents under their own "teamcity" accounts to more explicitly control permissions and allow access to network shares.)


Installing Visual Studio 2010 DOES fix this problem. But, you can also fix it by copying the appropriate build targets to your machine. Typically, on your dev machine they'll be at (Or take away the (x86) for 32 bit machines):

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web

In there you'll find a bunch of Microsoft.Web.Publishing.* targets.

Just copy those over to the equivalent location on your build machine and all will be well.


Installing Web deploy tool through web platform in the server works for me. Actually visual studio installation installs web deploy, It might be the reason why it works for @himinaya.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜