Package and Deploy not working on one of the agent

I have a package and deploy configuration. I am using the following to execute the package and deploy from teamcity build agent.

msbuild with follwoing parameters on a 4.0 framework
/M /P:Configuration=%env.Configuration% /P:DeployOnBuild=True /P:DeployTarget=MSDeployPublish /P:MsDeployServiceUrl=%env.TargetServer%/MsDeployAgentService /P:MSDeployPublishMethod=RemoteAgent /P:CreatePackageOnPublish=True /P:Username=%env.username% /P:Password=%env.password%

It is not packaging and deploying on the destination server. Build is successfukl after it building the project but actually it is not executingthe web deploy command. Any idea what I am missing here. How it actually owrks on teamcity. as it is working fine if i do it from a command prompt

please guide.

3 comments
Comment actions Permalink

This post is really old but I am having this same problem with getting TeamCity to deploy a MS Deploy package.  Web Deploy has been installed on the TeamCity agent server and I have setup the MSBuild build runner with the appropriate MSDeploy settings (that I know work if run from a command line).  The TeamCity build succeeds but in the TeamCity build log there is nothing there in regards to the MSDeployPublish target being called.  It seems like it is not even trying to call the MSDeployPublish target.


Build parameters I am using:
system.AllowUntrustedCertificate  true
system.Configuration  Release
system.DeployOnBuild  true
system.PublishProfile  CI
system.Password  someuser
system.UserName  somepassword


And here is the build log output:

[10:25:09]Skip checking for changes - changes are already collected
[10:25:09]Publishing internal artifacts
[10:25:09]Clearing temporary directory: C:\BuildAgent3\temp\buildTmp
[10:25:11]Using vcs information from agent file: 4b4f64e44f5edf57.xml
[10:25:11]Clean build enabled: removing old files from C:\BuildAgent3\work\4b4f64e44f5edf57
[10:25:11]Checkout directory: C:\BuildAgent3\work\4b4f64e44f5edf57
[10:25:11]Updating sources: server side checkout (1m:11s)
[10:26:23]Step 1/1: Package and Deploy (MSBuild) (2m:26s)
[10:26:23]Starting: C:\BuildAgent3\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\BuildAgent3\work\4b4f64e44f5edf57 "/msbuildPath:C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe"
[10:26:23]in directory: C:\BuildAgent3\work\4b4f64e44f5edf57
[10:26:24]Targets were not defined in the build configuration.
[10:26:27]MyProject.Web\MyProject.Web.csproj.teamcity: Build target: Build (2m:21s)
  [10:26:27]CheckPrerequisites
  [10:26:27]RestorePackages
  [10:26:28]PrepareForBuild
  [10:26:28]ResolveProjectReferences (31s)
  [10:27:00]ResolveAssemblyReferences
  [10:27:00]GenerateTargetFrameworkMonikerAttribute
  [10:27:00]CoreCompile
  [10:27:01]_CopyFilesMarkedCopyLocal
    [10:27:01]GetCopyToOutputDirectoryItems
  [10:27:01]_CopyOutOfDateSourceItemsToOutputDirectoryAlways
  [10:27:01]CopyFilesToOutputDirectory
  [10:27:01]MvcBuildViews (1m:47s)
  [10:28:49]Process exited with code 0
[10:28:50]Publishing internal artifacts
[10:28:51]Build finished

0
Comment actions Permalink

Hi,

I found that users have already faced with the same issue. Could you please try one of the suggested ways to solve it:

1.install the Azure SDK (1.8) on the build server and add parameter /P:PublishProfileRootFolder=<path to publish profiles>

2. abandon using PublishProfile then and use the additional parameters instead (please see examples from the link).


Please inform us whether it helps or not. Which version of TeamCity and Visual Studio do you use?

0
Comment actions Permalink

I finally got this working.  I had tried those StackOverflow fixes before but in addition to those suggestions I had to add the VisualStudioVersion which was causing the PublishProfile to be ignored.   For me it had to be set to 11.0.

We are using TeamCity Professional Version 8.1.3 (build 30101) and a mix of Visual Studio 2012 and 2013 on the team.  The build steps are setup to use MSBuild Version: Microsoft Build Tools 2013 and ToolsVersion: 12.0.

Here are the other errors I ran into along the way that will hopefully help someone else.

An error occurred when the request was processed on the remote computer.  The application pool that you are trying to use has the 'managedRuntimeVersion' property set to 'v4.0'. This application requires 'v4.5'.
To fix this error I added a build parmater for system.VisualStudioVersion with a value of 11.0.  Setting this value to 12.0 resulted in successful build but the publish profile would be ignored.

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS
The fix for this one was to add a system.BaseIntermediateOutputPath parameter set to  %system.teamcity.build.tempDir%\mywebproject\obj\

0

Please sign in to leave a comment.