How to make TFS 2010 deploy / publish a WPF application after build?

We have a WPF application and we use TFS 2010 for continuous integration. A new assembly is launched for each registration in the source control. All I want is to publish / deploy this project in a local folder after each build. How can i do this?

In fact, we have another WCF service project, and I managed to set up continuous integration for this. It is built, unit tests are run and then deployed to successfully debug the server. Build definitions I installed:

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 compiles, but nothing is placed in the destination folder. It is just empty. (By the way, I know that the destination folder is correctly defined in IIS, because if I publish the same project from VS2010, it will be successfully deployed and can be viewed using IE.)

I struggled with this for quite some time. I found many "close" questions and solutions, but none of them were useful to me. For instance:

  • Being inspired What is the easiest way to deploy a WPF application? , I added the โ€œCopyDirectoryโ€ activity to the build workflow, which copied the contents of the build output directory to my destination. This filled the output folder with a large number of files, which, apparently, were compilation products with .exe, .xbap and all DLL files, but they could not be used as a WPF application. An attempt to use the drag location turned out to be a similar result. When I try to view the application, 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. 
  • The following unanswered question was also found: http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/e9abf652-223f-4683-9c07-f3064cd4296f This is almost the same problem with me, except that I am using IIS 7 and Windows Server 2008.

So, how can I get TFS to deploy a WPF application after build?

+4
source share
2 answers

I do not believe that the default build template can be deployed immediately after the application.

You can follow these steps in the next post to add a click after the posting step http://social.msdn.microsoft.com/Forums/da-DK/tfsbuild/thread/8aed666d-a1fd-4cf5-ad44-13d5827e1e58 Although I would suggest put a 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 little longer to set up, but is much more flexible for deploying assemblies.

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

+2
source

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

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

0
source

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


All Articles