TFS2010 Build Doesn't Deploy Web Application

I am trying to deploy my web application automatically at the end of the automatic build, and I obviously missed something.

My setup:
VS2012 on Win7 Workstation
TFS2010 repository on the server

TFS build agent on serverb
Test site in IIS7 on server C.

I created a quick test project using the default MVC4 template and created a Team Project to use it using the MS VS Scrum 1.0 template.

I created a new publish profile for the web application using the publish dialog, and the .pubxml file is checked with the project. Pubxml looks something like this:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>MSDeploy</WebPublishMethod> <SiteUrlToLaunchAfterPublish>TestServer/DeployTest</SiteUrlToLaunchAfterPublish> <MSDeployServiceURL>http://TestServer</MSDeployServiceURL> <DeployIisAppPath>webapp-dev/DeployTest</DeployIisAppPath> <RemoteSitePhysicalPath /> <SkipExtraFilesOnServer>False</SkipExtraFilesOnServer> <MSDeployPublishMethod>RemoteAgent</MSDeployPublishMethod> <UserName>mydomain\myuser</UserName> <_SavePWD>True</_SavePWD> <PublishDatabaseSettings> <Objects xmlns="" /> </PublishDatabaseSettings> </PropertyGroup> </Project> 

* some names have been changed to protect the innocent :)

Using this profile, I can successfully publish a Visual Studio application to a test web server without any problems. Following the Scott Hanselman blog post, I successfully posted from the command line on my workstation:

msbuild DeployTest.csproj / p: DeployOnBuild = true / p: PublishProfile = Test / p: AllowUntrustedCertificate = true / p: Password = notTheRealPassword

Then I created an assembly in Team Explorer that will use my assembly server to compile and then run unit tests. Things are good. Projects are being built, module tests are underway.

Then I added parameters from the command line to MS Build Arguments in the extended section of the assembly definition:

/ p: DeployOnBuild = true / p: PublishProfile = Test / p: AllowUntrustedCertificate = true / p: Password = notTheRealPassword

Build runs, unit tests pass, nothing is published on the web server. :(

Can someone enlighten me about what I missed? Nothing I read seems to indicate the step I skipped, but there would seem to be very little documentation to explain how this is done.

+4
source share
2 answers

It seems that tfs might not support profile publishing.

You may need to pull all the parameters from the profile and specify them manually.

Here is a similar question.

Team Build: Publish Locally Using MSDeploy

+1
source

I know this is an old question, but today I came across the same problem, and I think I know the reason for the behavior that you observed. Let me summarize:

  • You have created an Internet Deployment Publishing Profile.
  • When you use a profile from the command line using the MSBuild command, the site is published successfully.
  • But when you use this profile from the assembly definition (specifying MS Build Arguments in the extended section of the assembly definition), the site does not publish.

I think the reason is that you have VS 2012 on your workstation that supports publishing using the profile function. Therefore, when you start the MS assembly from the command line on your workstation, the site is published. But publishing profile support is not available in TFS 2010, so the build server is not published.

Today I ran into the same problem and I decided to do the following:

  • On a TFS machine, from the command line, I ran the MS Build command with the publish profile. The team worked successfully, but nothing was published (copied) on the site. This proves that the TFS 2010 server does not support public profiles.
  • I had VS 2010 deployed on a TFS machine. I installed Web Deployment 3.5 and the Windows Azure SDK for Visual Studio 2010. This is a way to provide support for profile publishing on VS 2010.
  • Then I launched the MS Build team using the published profile from the command line and published the site successfully.
  • Then, finally, they completed the build definition with MS Build parameters, and the site was successfully published.

I know that installing Visual studio on a TFS machine is not an ideal solution, but at least it solved my problem. I am also not sure why installing VS 2010 with profile publishing support resolved the issue. But it seems that after installation, some of the missing / dll components were deployed to the TFS machine, which solved the problem. Hope this fixes the deployment issue.

[UPDATE]: Perhaps there was another reason for this behavior. Check assembly activity log messages. If you find a warning similar to this: C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (484, 9): warning: The OutputPath property is not set for Project ProjectName.csproj '. Make sure you specify the correct combination of configuration and platform for this project. Configuration = 'Release' Platform = 'Any processor'

Then this may be due to the assembly configuration. If you use "Any processor" as the build configuration, change it to "AnyCPU" (remove the space). For a detailed explanation, refer to the following link:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/0bb277ec-a08c-4795-88f0-3207654e2560/the-outputpath-property-is-not-set-for-project-xxxxxbtproj-please- check-to-make-sure-that-you? forum = tfsbuild

Amey

0
source

Source: https://habr.com/ru/post/1438012/


All Articles