Branching in TFS - tfs

I have a web application (C# and Angular). There are two folders called "Views" and "Resources" which will be different for each customer. I would like to have them all under TFS. Any suggestions?

I would create a single set of Views and Resources that excersize the functionality that you are building for all customers.
You should use an automated build to package your vanilla site and deploy it to your development server continuously. Ideally you should package your vanilla site as a zip or Nuget package.
Then, in a separate folder (TFVC) or Repo (Git), you create a resource/view set for a customer. Have your solution pull the packaged vanilla site and unpack it (so it'snot under source control here) and let'syou run the site for development.
Package and publish each customers customisations along with the vanilla site.
Now when you go to ship to a customer you can have a script that pulls the vanilla+customer packages and deployes the site.
If you want you can publish the bits to a known and accessible location and have your site self update.
You might also leverage the release management tools to deploy.

Related

Is it possible to copy build files to multiple drop folders on TFS?

I have two web servers that I am testing with some MVC applications. When I create a build definition in Visual Studio I would like to utilize two drop folders (one on each server) but this doesn't seem possible. I know there are a lot of ways around this by manually copying the files, setting up a data replication or creating multiple build definitions but I am looking for the simplest way. Any ideas?
Add a post-build script that will copy the files to the second web server.
The result of a build is always one drop folder, however you will get a subfolder for each web application(look in /_PublishedWebApplications/MyWeb/). As either a post build PowerShell, or as a release management activity you can have both of those web applications deployed to one or more servers.
In the default build template there are place to call PowerShell. You should use the post-test location to call a script that deploys your apps.
If you have a progression of environments, like dev->qa->prod, then you can use the release management tool to create a pipeline for each or both of your applications.

Should umbraco & umbraco_client be checked in to source control?

Just installed the latest Umbraco (7.2.1) package via NuGet. My development environment is as follows:
Umbraco is installed installed on IIS8 as shown below and is all up and running.
My Visual studio project is set up as shown below (For the sake of clarity, any folder/file excluded from project is not in included in my source control.
The content folder houses all scripts, images & css
On build - bin, config, content, masterpages, usercontrols, Views, xslt, default.aspx, Global.asax & the transformed Web.config are copied to the IIS instance (I don't like running Umbraco in the same place as my project, it just seems messy.)
Is this an appropriate way of developing for Umbraco? Am I missing anything, my biggest concern is whether or not I should include the umbraco & umbraco_client folders in version control and in the post build action. Any suggestions would be great.
There is some debate over what should and shouldn't be in your repository and ultimately it comes down to personal preference. I used to only add custom files and files that I changed from the Umbraco install such as the config files however since the introduction of the Nuget package I do put all but the binaries into source control because when I upgrade via Nuget later on I can easily see changes and merge customisations back in.
It saves a lot of hassle running Umbraco directly (IMO) especially if you make any changes via the UI and if you're not running it directly then there is little point really in using the Nuget package because you will end up with a bunch of unused files in your project. In your situation you might as well keep your project clean and do a manual install into the location IIS is using for the site and only keep files in your project that you have created.
This is only my opinion so take from it what you wish but hopefully it is of some help.
Simon

Best Practices for TFS and MVC projects - deploying changes only

I have several websites that I manage for a company and they want me to transition to TFS. As part of their policy, I can only deploy files that have changed since the last deployment. I.e. if a view has changed then it gets deployed, if it has not changed then it not part of the deployment package. They use automated tools for the deployments.
Currently I use a custom tool I wrote that hooks into my local source provider (Vault Pro) and finds all the changes from a given date and copies those files to a zip file.
How can I accomplish something similar with Team Foundation Server?
TFS provides you with an SDK that you could use to query it from code. Here's the documentation of the client API.

How to handle 3rd party libraries in TFS 2010

At my work we are just starting to use TFS with our team of 4 developers, and are at the same time transitioning from single developer projects to team projects. We are mostly using the default settings in TFS
I was the first to push up a simple Silverlight MVVM project consisting of a solution with a Silverlight and a web project.
When my team-mate pulled down my code and tried to compile, he was faced with many missing references (.dlls), Expression blend SDK, Ria Services toolkit, Telerik controls, simple mvvm toolkit, silverlight toolkit, etc.
What do we need to do, to add projects to TFS that have everything needed to be compile it when the next developer pulls it down?
There isn't a really good way to do this all automatically. What you'd generally do this this:
in your branch create a bin folder next to your src folder.
in the bin folder create folders for each component you're relying on
in each folder place the setup or a link to the setup
in each folder place the binary files you're using in your solution
in each folder place a readme with any manual steps that must be completed
if wanted you can create a powershell script or batch file which installs all required components. It isn't too hard to detect whether or not an application is already installed using powershell and wmi
Now you'll have to fix a few things in your solution:
make sure your references don't point to the GAC, but that they point to the assemblies inside the bin folder of your branch
make sure all the paths are relative to the solution. Any c:... paths will not carry over from one system to another
I found that the easiest way to do this is to unload the project in Visual Studio and then edit it. You can then quickly add hintpath="..\..\..\bin\component attributes to each reference. There are a few blog on this subject which provide different solutions which all solve this same issue.
This setup allows you to at least get the latest version of any solution and build it without having to install any tools. If some of your components rely on visual studio add-ins, then the designers for these tools usually won't work, but at least you're able to build them.
An often used alternative is to create a Virtual Machine base image for your project and install all the required components onto it. Then copy the image to each developers workstation and sysprep it to ensure they all have a unique name and identifiers. When the project needs to update its dependencies, let one developer create a new clean machine and re-distribute that to all team members.
If you're using Windows Server Virtualization or VMWare, it's quite easy to create differencing disks and allow developers to access these images remotely.
Another approach would be to use NuGet and script NuGet using a powershell script for your solution. This will work for most cases, but products like Expression Blend still need to be installed separately.

WebDeploy to deploy multiple web sites

We're using this process to use WebDeploy to deploy and compile two web sites that are a part of the solution. The approach we took was found here:
http://vishaljoshi.blogspot.com/2010/11/team-build-web-deployment-web-deploy-vs.html
But it's only deploying one of the web sites; is there a way to tell it to publish both?
Thanks.
Web Packages created based on the above walkthrough (i.e. via VS 2010 and its derivatives like TFS etc) can only contain one web project. Unfortunately VS generated Web Packages will be limited from this sense. If you use Web Deploy (MSDeploy) EXE or API directly and then you can package more than one web site within IIS etc. I believe you are trying to accomplish this via Team Build so that is not really an option.
Although, in Team Build you can create more than one build definitions to cause multiple packages to be created. You can also set properties in your .csproj or .vbproj file (same properties mentioned in Step10 of the walkthrough). If more than one project have properties DeployOnBuild set to be true then from within single solution build within TFS you can have multiple web packages generated. You will still have to deploy each web independently.
Hope this helps

Resources