How to Ignore Whitespace in Visual Studio with Team Foundation Server

Basically, we are going to add a command line argument to the tool that Visual Studio uses to compare files.  The tool is called diffmerge.exe, and we are going to add the /ignorespace argument when this is ran.

  1. Open Visual Studio.
  2. Navigate to Tools –> Options.
  3. Browse to Source Control on the left and click on Visual Studio Team Foundation Server.
  4. Click Configure User Tools.
  5. Click Add to create a new tool.
    • Extension: .*
    • Operation: Compare
    • Command: [Your Visual Studio Location in Program Files]\Microsoft Visual Studio [Your Version]\Common\IDE\diffmerge.exe
      • For example, C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\diffmerge.exe
      • NOTE: If you have a 64-bit version of Windows, you should see two directories for Visual Studio (one under C:\Program Files\ and another one under C:\Program Files (x86)\).  The diffmerge.exe file is located in C:\Program Files (x86)\Microsoft Visual Studio x.x directory.
    • Arguments: %1 %2 /ignorespace
      • NOTE: Your Arguments field may look a little different (i.e. %1 %2 %3 %4 /x /y), but don’t worry about what it looks like–you just need to be sure to add /ignorespace to the end of your arguments.
  6. Click OK to save and bingo–you’re done!

Your Thoughts?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s