Code Compare in Visual Studio

By using the Code Compare tool as an add-in, you can enhance your Microsoft Visual Studio experience with robust functionality which allows you to quickly and efficiently compare, diff and merge objects. The following Visual Studio versions are supported: 2015, 2017, 2019 (except for the Express editions). Learn how to compare and merge source code in Visual Studio 2019.

Compare Files and Folders in Visual Studio

Code Compare adds dynamic toolbars and menus to Visual Studio to ensure that you can easily compare folders and text files directly from the IDE.

Added dynamic toolbars:
  • Code Compare Layout toolbar;
  • Code Comparison toolbar;
  • Folder Comparison toolbar;
  • Text Editor toolbar.

Added dynamic menus:
  • Comparison - This menu contains commands for comparison customization.
  • Changes - This menu allows you to navigate between changes and add them to the required document taking part in the comparison.
  • Layout - This menu allows you to customize the display of comparison panes.

How to start comparing files:

To start comparing two files in the Code Compare Visual Studio add-in, you can use any of the following methods:

  • • click File in the main menu bar, select the New sub-menu and then select Code Comparison;
  • • click Tools in the main menu bar, select the Code Compare sub-menu and then select New Code Comparison;
  • • locate the required file in the Solution Explorer window, right-click it and choose Compare Selected File in the context menu;
  • • open the required file in Visual Studio, right-click the required document name in the document tab well and in the document's context menu select Compare Current File.
Code Compare with Visual Studio

Version Сontrol Systems Integration

Code Compare can be used as a Git merge and diff utility in Visual Studio to compare folder structure changes between different versions or revisions of your code. This is possible due to Code Compare's ability to be integrated with various version control systems. The main features made possible by this are:

  • • structural code comparison that enables comparison of your source code by its signature;
  • • lexical comparison that detects different lexemes;
  • • syntax highlighting that locates and highlights language syntax elements.

The list of supported languages in Code Compare for Visual Studio features most popular languages and has recently been updated with JavaScript and TypeScript.