Categories: Blog

Cool Dev 11 Trick: Diff Random Files Easily

Dev 11 has a diff and merge view that is simply outstanding and using it to compare changes before checkin is just dreamy. I ran into a situation where I wanted to diff the output of two files and thought that it would be nice if I could do that in Dev 11. Popping into CTRL+Q and typing “diff” just says, “No search results available”, which isn’t very helpful.

Figuring there had to be a command related to diffing, I looked up all the commands in the Keyboard Options page and ran into Tools.DiffFiles. Running that in the Command Windows did nothing so going for broke, I typed “Tools.DiffFiles c:” and got a nice little autocomplete popup to choose the file. Obviously, Tools.DiffFiles takes two parameters, the first being the left side file, or the source, and the second being the right side file, or the target. Below shows an example from the Command Window

  1. Tools.DiffFiles c:\test\a.txt c:\test\b.txt

That’s great we’ve got the ability to do random diffs inside the IDE, but being a command line guy, I want to do the diffs directly from PowerShell even if Dev 11 isn’t running. It turned out to be far easier than I ever imagined. Checking the command line options to DEVENV.EXE, by running “devenv /?” showed there’s a new command line switch. /diff, that does exactly what I wanted. So anytime you want to use the Dev 11 diff tool, run the following:

  1. devenv /diff c:\foo\x.txt c:\bar\y.txt

If Dev 11 is running, you’ll get a new diff window in the running instance, otherwise, you’ll get a new copy of the IDE. Of course, you’ll need devenv.exe in the path so run VCVARSALL.BAT to get it in your path.

John Robbins

Recent Posts

8-Step AWS to Microsoft Azure Migration Strategy

Microsoft Azure and Amazon Web Services (AWS) are two of the most popular cloud platforms.…

3 days ago

How to Navigate Azure Governance

 Cloud management is difficult to do manually, especially if you work with multiple cloud…

1 week ago

Why Azure’s Scalability is Your Key to Business Growth & Efficiency

Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…

3 weeks ago

Unlocking the Power of AI in your Software Development Life Cycle (SDLC)

https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…

1 month ago

The Role of FinOps in Accelerating Business Innovation

FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…

1 month ago

Azure Kubernetes Security Best Practices

Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…

2 months ago