Installing and Configuring Microsoft Visual Studio 2012 Shell for use with PHP Tools, Team Explorer, and Git

My small team cannot afford to purchase the full version of Visual Studio 2012.  Thankfully, Microsoft provides a free ‘Shell’ version that can be used with extensions to create a standalone IDE.

First, you will need to download the Microsoft Visual Studio 2012 Shell (Isolated) Redistributable Package and install it on your system (this will require a reboot).

Once that has completed you can install the Microsoft Visual Studio 2012 Shell (Integrated) Redistributable Package

At this point you will want to install Visual Studio 2012 Update 2, this update is required for many of the following steps.

At this point you will have a copy of Visual Studio 2012 installed; however, it will not have any languages installed into it.  Since we will be developing for PHP, we need to install a PHP editor – we chose PHP Tools.  You should install this extension (or another PHP extension of your choice) now.

Next, you will want to install Team Explorer for Visual Studio 2012.  This will add the ability to connect to Team Foundation Service to your Visual Studio 2012 installation.

Finally, in order to use Git with Team Explorer/Team Foundation Service – we need to install Visual Studio Tools for Git.  This step is a bit tricky because for some reason the ability to install Visual Studio Tools for Git is not available with the Shell version of Visual Studio 2012.  I will show you how to get around that limitation:

Preparing Visual Studio Tools for Git for Installation in Visual Studio 2012 Shell

  1. Download Visual Studio Tools for Git
  2. Next you will need to extract the files from the .msi that you have downloaded.  To do this, I created two folders on my machine – c:\temp and c:\temp2.  Move the .msi file into c:\temp and then open a command prompt (In Windows 7: Click Start, type ‘cmd’, press ‘Enter’)
  3. Enter the following into the command prompt:
    msiexec /a c:\temp\Microsoft.TeamFoundation.Git.Provider.msi /qb TARGETDIR=c:\temp2
  4. This will extract the files from Microsoft.TeamFoundation.Git.Provider.msi into the c:\temp2 directory.  This should be a file called GitProvider.vsix.  You will now need to unzip the .vsix to get to files inside of it (7zip is a good program for this).
  5. Once you have unzipped the .vsix file there will be a file  called extension.vsixmanifest – use your favorite text editor to open that file (I recommend notepad++)
  6. Find the parent node <Installation> in the XML.  You will see several children here that begin with <InstallationTarget Version=”….  You want to add a new child here at the bottom:
    <InstallationTarget Version=”[11.0,12.0)” Id=”Microsoft.VisualStudio.IntegratedShell” />
  7. Save this file and close it.  Now, delete the original GitProvider.vsix and then select all of the files in this directory.  Right click on your selection and choose ‘Send to->Compressed (zipped) folder’ to zip the .vsix back up with the change you made.
  8. Rename the zipped file as GitProvider.vsix.
  9. Double click on GitProvider.vsix to install the extension into Visual Studio 2012 Shell.

 

How to Delete a Team Foundation Service Project

  1. Open a command prompt (In Windows 7: Click Start, type ‘cmd’, press ‘Enter’)
  2. Enter the following in the command prompt:
    cd /Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/ 
  3. Press ‘Enter’
  4. Enter the following in the command prompt:
    tfsdeleteproject /collection:https://yourprefix.visualstudio.com/DefaultCollection yourprojectname
  5. Press ‘Y’ and hit ‘Enter’

Setting Up a Localhost Development Environment with XAMPP for WordPress MU (multisite) Development

This is the first in a 4 part guide for Setting up Visual Studio 2012 and Team Foundation Service using Git for WordPress MU (multisite) and PHP Web Development.

If you want to setup a localhost environment for WordPress development very easily you may want to look into using WebMatrix.  The way that WebMatrix installs WordPress unfortunately does not work with WordPress MU, and since we want to develop for WP multisite, we will be using XAMPP instead.

Grab the installer and run through the installation, I will assume that you chose to use the default directory of c:\xampp.  I recommend installing Apache and MySQL as a service, but you can also just start and stop them manually from the XAMPP control panel.  After installation is complete and the Apache and MySQL services have been started, go to your browser and navigate to: http://localhost/xampp/.  You will get a notice about XAMPP being unsecure, run through the security page and fix that.

Next, click the ‘PHPMyAdmin’ link on the left and use the username and password you setup on the security page to login.  Click on the ‘Users’ tab at the top of the screen, then click ‘Add User’ on that screen.  Enter a username for the user (I used ‘wordpress’) and then either create and confirm or generate a password.  Write this password down somewhere (something like KeePass or LastPass is great for this kind of thing).  Next to Host, select the dropdown and pick ‘Local’ – don’t forget to do this, the WordPress installation will fail if it is left as ‘Any Host’.  Scroll down to Database and select ‘Create database with same name and grant all privileges’, then click ‘Add User’.  You are done with PHPMyAdmin.

Now, download WordPress and unzip either into the root of c:\xampp\htdocs (that’s where I put it, so that it could be accessed at http://localhost, or create a folder in c:\xampp\htdocs and unzip it into that folder (it will be accessed at http://localhost/foldername).  Once it is unzipped go back to your browser and visit the location where it was unzipped, http://localhost in my case.  You will see the WordPress installation wizard.  Enter in the database connection info from the ‘wordpress’ database you created in PHPMyAdmin and complete the installation.  To create a WordPress multisite installation follow the WordPress Create a Network Instructions.

Congrats, you know have a WP multisite installation available at http://localhost for development.  Next time we will have a look at setting up Team Foundation Service.

 

Setting up Visual Studio 2012 with Team Foundation Service (with Git) for WordPress MU and PHP Web Development

This post will detail what you need to setup Visual Studio 2012 (we will be using the free Shell version with PHP Tools) with Team Foundation Service for WordPress MU and/or PHP Web Development.  This guide is meant as a quick setup guide for small teams (5 or less) who are interested in using Visual Studio 2012 for their PHP web development needs and using Team Foundation Service for source code control.

Disclaimer:  The information in this guide is a result of my own research and experimentation when looking to setup version control for my small web development team for managing WordPress plugin and theme development.  We researched using Git, Mecurial, and TFS.  We used Git exclusively for a while but recentely setupI started this project without any exposure to content versioning / source code control so hopefully my experiences will be of some benefit to someone else out there looking to solve the same problem.

This guide will be dividing into the following sections:

  1. Setting up the Localhost Environment
  2. Visual Studio 2012
    • Installing Visual Studio 2012 Shell (Isolated)
    • Installing Visual Studio 2012 Shell (Integrated)
    • Installing Visual Studio Update 2
    • Installing PHP Tools for Visual Studio 2012
    • Installing Team Explorer 2012
    • Installing Visual Studio Tools for Git
      • Downloading and unpacking the .msi
      • Unzipping the VSIX
      • Modifying the Installer to work with Visual Studio 2012 Shell
      • Repacking the VSIX and installing
  3. Team Foundation Service (coming soon)
  4. Using Team Foundation Service (and Git) with Visual Studio 2012