Skip to main content
net10.0net11.0

Locate and resolve external diff tools

Published
Nov 13, 2026
4d ago
Total Downloads
44.3K
44,288

Install

dotnet add package Meziantou.Framework.DiffEngine --version 2.0.17
ProductVersions
.NET
net10.0net11.0

README

Meziantou.Framework.DiffEngine

Meziantou.Framework.DiffEngine resolves installed diff tools and provides launch arguments for comparing two files.

This package is designed for snapshot testing scenarios and is API-compatible with the subset needed by:

  • Meziantou.Framework.SnapshotTesting
  • Meziantou.Framework.InlineSnapshotTesting

Supported public API

  • DiffTool enum
  • DiffTools.TryFindByName(DiffTool, out ResolvedTool?)
  • DiffTools.TryFindByExtension(string, out ResolvedTool?)
  • ResolvedTool (Name, Tool, ExePath, SupportsText, BinaryExtensions, GetArguments)

Example

if (DiffTools.TryFindByName(DiffTool.VisualStudioCode, out var tool))
{
    var arguments = tool.GetArguments("received.json", "verified.json");
    Assert.Equal("--diff received.json verified.json", arguments);

    // Start the tool with Process.Start(tool.ExePath, arguments)
}

Environment variables

  • DiffEngine_<ToolName>: override executable detection for one tool (file path or directory). When the variable is set but the executable cannot be found, TryFindByName throws so the typo is not silently ignored, while TryFindByExtension skips that tool and keeps looking at the others.
  • DiffEngine_TargetOnLeft=true: invert generated argument order

Changes from Previous Version

No structural changes between v2.0.16 and v2.0.17.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.