Method 1: Using the Command Window (Tools.DiffFiles)
Visual Studio includes a full diff engine, but the easiest way to access it is through the Command Window. This method works with any files you have open, even if they aren’t part of the solution.
- Open View → Other Windows → Command Window.
- In the Command Window, type:

Method 2: Using Solution Explorer (Compare Selected)
If both files are part of your project or solution, Visual Studio gives you a more discoverable—but still underused—comparison option.
- In Solution Explorer, Ctrl-click the two files you want to compare.
- Right-click → Compare Selected.
- Alternatively, right-click one file → Compare With… and choose the second file.
Visual Studio immediately opens the diff viewer with the same rich comparison features as Method 1. This method is perfect when you’re reviewing changes across versions, comparing generated files, or validating refactors inside the solution.
Which Method Should You Use?
- Use Method 1 when the files are open but not part of the solution.
- Use Method 2 when both files live in Solution Explorer and you want a quick right-click workflow.
Both methods use the same diff engine—only the entry point changes.