TFS 2010 Build ClickOnce deployment files - tfs

My application consists of a Server and Client. Each of our customers has a PC that will host the server and a clickonce deployment of the client that they can then install on whatever PCs they want to have it. I am currently trying to find out the best way to handle this since the support for publishing clickonce installers from TFS Build seems to be nonexistent.
The publish URL for each customer will be different so I would like to have a separate build for each customer that just reuses the binaries built for the server and client.
My ideal solution would be having a team project for the code (Server and Client) and then a separate team project with folders for each customer. The Customers Team Project would also house the binaries from the builds of the Server and Client. Then I would create a build for each customer that would change the publish url of the client clickonce .application file and re-sign it.
The biggest place I am stuck right now is how to get the clickonce publish files from Team Build, but I am also curious if there is just a totally better way to do this that I have missed.
Thanks

See "Building ClickOnce Applications from the Command Line [MSDN]"
I think you could set up a MSBuild workflow activity in Team Foundation Build to publish each of your customer's projects, if you're using the default Workflow template.

Related

How do I invoke a publish profile in an automated TFS2017 build?

I have successfully upgraded to VS/TFS 2017, and I am at the point where I want the build to automatically publish a website to a staging location using one of the project's publish profiles. I am impressed with the flexibility in the "Build & Release" section of the TFS Team Project Site, but it's a little overwhelming.
This project has 2 simple publish profiles. Both use the 'FTP publish method' to upload to the Go Daddy hosting provider; one deletes all files before upload, the other only updates files. There are transforms applied for things like connection strings. These publish profiles work properly. I just need them to be added at the end of an automated build.
It would seem it should be simple to say 'use this publish profile', but there are so many options and choices it's not intuitively obvious which to use, and I haven't been able to find a reference on the web that focuses on what I want to do.
If you want to invoke the msbuild command using the publish profile to publish website to FTP location, then it's impossible as FTP publishing is not supported on the command line.
If you insist on invoking the publish profile, then you can invoke msbuild command line with the publish profile used to publish the website to a staging location (eg, local or UNC path), then use FTP upload task step to upload the website from the staging location to the specific FTP location, or using PowerShell script to upload the website.
You can reference this thread:
How can I add FTP website deployment to a VS2015/TFS2013 build process

VSTS Build Not Dropping All Files for Web Application

When I started writing this question, my problem was that after a successful VSTS Build, I wasn't able to see the files relating to my web application project for release. Only the files from certain other projects in the solution were present. However, I just came across this question, which has helped.
I can now see the compiled .dll files for my web application project, after altering the configuration of the Content setting in the Build - that is, the contents of the Bin folder under that project. But I can't see anywhere the other files I need to copy the built web application to my server - the views, the scripts, the css, etc.
I'm finding the power and flexibility of VSTS's Build and Release functionality very confusing as it's complete overkill for our requirements. Up until now, I've just right-clicked on the web app project in Visual Studio selected Publish and used the File System publish method. Easy. Now that I want to automate the building and deploying of the application, it's many times more complicated!
So, can anybody tell me how I can get the solution to build in VSTS in such a way that I can then use a Copy Files task in the Release Definition to copy the files to our web server (the server isn't visible to the Internet so I'm using a locally-hosted Agent)?
In vNext build, to publish your build artifacts with the Copy files or Publish build artifacts steps. Try to use the local path on the agent where any artifacts are copied to before being pushed to their destination. For example:
Add /p:DeployOnBuild=true
/p:OutDir="$(build.artifactstagingdirectory)\" arguments in Visual
Studio Build step;
Change "Path to Publish" of Publish Build Artifacts task to
$(build.artifactstagingdirectory)\_PublishedWebsites\ProjectName:
Details please check the screenshot of build step with this question: How do I get the the expected output from a TFS 2015 build (to match my XAML build)?
Base on your comments, you have published the web app from Visual Studio. Usually, this action will generate a publish profile under Project/Properties/PublishProfiles folder. The settings you used to publish the web app is stored in the profile. So you just need to make sure this publish profile is checked into source control. And then in the TFS build, add following MSBuild arguments:
/p:DeployOnBuild=true /p:PublishProfile="publishprofile.pubxml"

Set up Team Foundation Server Build service to do automatic builds and testing

Our plan is to use Team Foundation Build service to do automatic builds, then use the testing facility to automatically perform testing on the build server then release that build onto the application server.
So far we have
Team Foundation Server with TF Build Controller configured
Build server with win2012, Visual Studio 2013 and Build agent configured.
SQL Server with SQL 2013 installed
Application Server with Win2012 and .netframework installed
My question is what do I need to do to set up automatic builds, and to execute the unit test harness once compilation is successful.
Also the deployment target machine will initially be DEV, however we would like to quickly build for test env and prod etc.
This is what I got so far.
Build Controller (Already set up I believe)
Build Agent (Already installed on build server)
Build Process Template (Do I need to do anything with this. Is this what controls the whole lot)
Team Build Definition (I had a look at this, and it seems to use the build process template)
Drop Folder (I am assuming this is where the executables will be dropped into).
At the moment I have bits and pieces of info, what I would like to know is how this whole thing is hanging together. From the moment the developer wants to do the build to the moment that exe is placed into the DEVAPPSERV (Development application server).
Is anyone able to point me in the right direction or give a summary of what I need to make this happen?
Many thanks,
Dalibor
Install TFS Server (TFS Disk) Create a Team Project Collection and any desired Projects
Install TFS Controller + Agents onto a dedicated machine (TFS Disk) Configure only the build options if on a different machine to the TFS Server
Configure Build Controller to connect to a Specific Team Collection on your TFS Server
Install VS Premium or higher on build machine, if you want code coverage results for your tests
Add some code to TFS Source Control
Create a Build Definition using the default template.
Configure the build definition.
Set the working folder for the build, include only what you need as this will speed up the process
Point the definition to your .sln or proj file.
Ensure testing is enabled and that your test assembly names will match the regex used to identify test dll's i.e. name your test assemblies with the word test.
Set the trigger to be CI or what ever flavour of build you require i.e. gated build
Save the build definition
Trigger a manual build and debug any issues
you should have the basics done and a repeatable build created.
That should cover the basics, you may want to customise the build template (see Ewald Hoffman's guide for tips), you may want to narrow down your code coverage (look for runsettings file info).
If you follow these steps you should be able to get a basic build created and running from these, if you hit any issues you can come back and ask specific questions about a particular area
In order to do automatic builds you should check the CI build option ( under the trigger build option ) and third party automated testing can be run by executed by a post build script.
See the following TFS article about post build scripts.
http://msdn.microsoft.com/en-us/library/dn376353.aspx

TFS Service 2012 Build Process Template (XAML Workflow) with FTP Publishing (Deployment)

I have web site project hosted at TFS Cloud. And I have hosting account at Godaddy, which allows me to deploy sites via FTP only.
I create publishing profile in Visual Studio 2012 and can successfully execute publishing to FTP in Visual Studio.
The problem:
This the task cannot be done using any standard TFS Build template and neither its standard workflow activities, even though it should be a trivial thing people do with TFS Build server. There is no ready "copy-paste" solution (wpp.targets) on MSBuild for that:
"C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Deploy\Microsoft.Web.Publishing.Deploy.FTP.targets"
Clearly says that it is not supported through the command line, one should use VS for that.
Question:
Is there any implemented solutions of that task that I can just copy paste to my team project with few clicks?
I expected to see lots of articles about it in web, however I didn't find any simple existing solution. Articles like this require me to install some 3rd party software (which is not an option in most popular hosting like Godaddy), and it's not clear how to use it with TFS.
In the default Build template, go to the process section and choose Msbuild Arguments and give the publishing profile.
MSBuild Arguments : /p:DebugSymbols=false;DebugType=None;DeployOnBuild=true;PublishProfile=YourProfileName
when Build got succeeded, it will be deployed to the ftp location.
this link may help you more : http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx

How to have tfs publish specific folder using web deploy

I need to publish a specific folder in my project to my web site using tfs builds. I know tfs copies to a drop folder but I also need it to publish to my web server when I queue a new build. Is there anyway I can do this? I currently have web deploy installed on my server and I have tested it and know it works. Would these be some type of build definition? I can only find sample definitions that copy to a UNC path.

Resources