Question

We have a WPF application and we are using TFS 2010 for continuous integration. A new build is triggered for every check-in to source control. All I want is to have this project published/deployed to a local folder after every build. How can I do this?

Actually we have another WCF service project, too, and I managed to set up continuous integration for that. It is built, unit tests are run and then deployed to debug server successfully. The build definitions that I set are:

    Clean Workspace = None
    Copy Outputs to Drop folder = False
    MSBuildArguments =
    /p:DeployOnBuild=True
    /p:DeployTarget=MsDeployPublish
    /p:MSDeployServiceURL=http://<serverIP>
    /p:DeployIISAppPath="/DebugSite"
    /p:CreatePackageOnPublish=True
    /p:MsDeployPublishMethod=InProc (changed from RemoteAgent, didnt bother to try and remove other parameters)
    /p:AllowUntrustedCertificate=True
    /p:UserName=...
    /p:Password=...

But when I use the same configuration for this WPF project, it is compiled but nothing is put to destination folder. It's just empty.(Btw I know that destination folder is correctly defined in IIS because if I publish the same project from VS2010, it's successfully deployed and can be browsed with IE.)

I have been struggling with this for quite some time. I found many "close" questions and solutions but none were useful for me. For example:

  • Being inspired from What's the simplest possible way to deploy a WPF application?, I added a "CopyDirectory" activity to the build's workflow which copied contents of the output directory of build to my destination. This filled the output folder with lots of files, which were apparently all the products of compilation with .exe, .xbap and all .dll's, but they were not usable as a WPF application. Trying to use a drop location ended up in a similar result. When I try to browse the app, I get the following error:

    An exception occurred while downloading the application. Following failure messages were detected:
     - Downloading http://server/DebugSite/MyProject.exe.config.deploy did not succeed.
     - The remote server returned an error: (404) Not Found.
    
  • Also found the following question unanswered: http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/e9abf652-223f-4683-9c07-f3064cd4296f This is almost the same problem with me, except I'm using IIS 7 and windows server 2008.

So, how can I make TFS deploy the WPF app after building?

Was it helpful?

Solution

I don't believe the default build template can deploy click once applications.

You can either follow the steps in the following post to add a click once publishing step http://social.msdn.microsoft.com/Forums/da-DK/tfsbuild/thread/8aed666d-a1fd-4cf5-ad44-13d5827e1e58 Although I would suggest putting the custom step after the "Check in Gated..." step to make it easier to find.

Or use something like Tfs Deployer (http://tfsdeployer.codeplex.com/) which takes a bit more to setup, but is a lot more flexible for deploying builds.

Another guide for click once http://www.edsquared.com/2011/10/27/Deploying+Visual+Studio+2008+ClickOnce+Projects+In+TFS+2010+Build.aspx

OTHER TIPS

Here is the solution I found before seeing Betty's answer. It has a few more properties set for publishing and manifest file, and is a bit more complicated. I suggest trying the link in accepted answer first, because it's simple to understand and apply.

http://thebasilet.blogspot.com/2010/10/tfs-2010-team-build-clickonce.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top