3

We have a TFS build definition set up where we pass the following extra MSBuild arguments in:

/p:DeployOnBuild=true;DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder;_PackageTempDir="\\server\build";AutoParameterizationWebConfigConnectionStrings=false

This has been detailed elsewhere as a way to have the published files copied to a specific location instead of generating a deploy package.

This unfortunately does not work on our build server, however if I run the exact same msbuild command line as called by TFS on my dev machine then it works perfectly and copies the output files to the location.

I have checked the log file and there is no errors, it just seems to completely skip the publish/deploy step.

Done building target "_BuiltWebOutputGroupOutput" in project "xyz.csproj".
Target "PrepareForRun" in file "c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets" from project "C:\Builds\2\xyz\xyz build\Sources\xyz.Web\xyz.Web.csproj" (target "CoreBuild" depends on it):

whereas on my local machine, after _BuiltWebOutputGroupOutput target is run the package target runs and deploys the files correctly.

I have tried using different paths and even setting the properties in the project file but it seems to make no difference. My local solution and project files are the same as in the repository that the TFS build is using. Is there something config related on our build server or with the build agent that would cause the packaging target not to run?

Rowan
  • 144
  • 1
  • 12
  • Have you tried running the same MSBuild command on the build machine itself? Does the MSBuild versions match between your devbox and the build machine? – Duat Le May 18 '11 at 20:02
  • MSBuild version is the same on both machines - 4.0.30319.1. .NET Framework version is the same. I've run msbuild manually with various option on the build server with the same results, the PackageTempDir is ignored. – Rowan May 20 '11 at 14:13
  • On the build machine, MSBuild run as the "Network Service" account which can make a difference. I'd also verify that the TFS Build is building the same configuration and platform as what you're building on the command line. Lastly, have you checked the MSBuild log file from your TFS build? – Jim Lamb May 21 '11 at 00:37
  • Running as Network Service didn't make any difference. I ran with the same config and platform - I've basically copied the MSBuild command from the build log and run that locally and the content is deployed fine, but it just doesn't happen on the build server. The MSBuild log file didn't reveal much - there doesn't seem to be any errors, it just doesn't call the Targets that get called locally when its doing the deploy. It's not a massive problem as I have put a copy command in the build workflow to get around it but it's a bit frustrating that it doesn't work. – Rowan May 24 '11 at 12:18

1 Answers1

2

I was having a similar problem today and found a fix so it maybe worth a look for you. Here

Community
  • 1
  • 1
samaspin
  • 2,342
  • 1
  • 26
  • 31
  • 1
    Revisited this for another project and the solution you linked to solved the problem - I was missing the C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web folder on the build server which has the necessary targets for Publishing. – Rowan Nov 11 '11 at 16:54