I'm looking for an open-source diff tool that I can integrate in my C# code.
I am comparing two strings of text and want to render my output to look similar to the Stack Exchange diff tool:
inline:
side-by-side:
Stack Exchange uses Beyond Compare, which seems to do a very nice job comparing changes, but I am looking for something that is free.
I found a few posts on Stack Overflow talking about diff tool recommendations, yet these questions are off topic for Stack Overflow and were closed, so the answers given are very likely not maintained. Also, all these questions were posted a few years ago, and so the technology suggested may no longer be the best software available.
Here are the SO questions for reference:
- Diff tool that can be integrated into a C# app - asked in 2012
- Does anyone know of an advanced diff tool for C#? - asked in 2009
- Any decent text diff/merge engine for .NET? - asked in 2008
These are some of the suggestions posted, yet I don't know if they are still recommended or if better technology now exists:
- https://code.google.com/archive/p/csdiff/ - seems like Google stopped supporting this in 2015
- https://github.com/mmanela/diffplex
- http://winmerge.org/downloads/ - source was last updated in 2012
- https://code.google.com/p/google-diff-match-patch/ - last release was in 2012