tags:

views:

2359

answers:

4

Requirements:

  • free, preferably open-source
  • implemented in one of the .NET managed langs

Google found these:

EDIT:

No apps please, only libraries.

+6  A: 

I think the "Generic - Reusable Diff Algorithm in C#" on Codeproject is the best you can find as a .NET-Engine for diff/patch/merge. I made a project on my own with it and it fits my needs with most scenarios. There are one or two worst-case scencario when the algorithm made the patch-file larger than it have to be. But in most of the cases it works just fine for me (textfiles with a size of >30 MB).

I'm currently testing another Codeproject-Project you can find here: http://www.codeproject.com/KB/applications/patch.aspx It's using some DLLs from Microsoft for patching, so it looks interesting. But those DLLs are unmanaged and this project is only some sort of wrapper for it. But maybe it can help you

Edit: Just found another project, DiffPlex: http://diffplex.codeplex.com/ It's a combination of a .NET Diffing Library with both a Silverlight and HTML diff viewer.

Anheledir
thanks for info! but I hope to find more sophisticated solution. I just can't believe nobody created some neat lib
aku
When you find a better library, please tell us (or at least me *g*) - I searched myself quite a while and didn't find anything beside the already mentioned.
Anheledir
A: 

The absolute best application for diff/merge/patch is WinMerge. Obviously this is a whole application, but its OSS on sourceforge so you can grab the internal bits of code.

I'm not sure if you class C++ as a .NET language or not, but you can compile it with Visual Studio with the CLI extensions.

gbjbaanb
You just didn't try Araxis Merge :)
aku
+3  A: 

You can grab the COM component that uses Google's Diff/Patch/Match. It works from .NET.

Update, 2010 Oct 17: The Google Diff/Patch/Merge code has been ported to C#. The COM component still works, but if you're coming from .NET, you'll wanna use the .NET port directly.

Cheeso
Looks like this has been ported to C# (full managed C# implementation). The C# version is availble in the download section on the Google page. You can edit out the "COM" bit of your answer. Nice find as this implementation (at least the python/js versions) are used in some widely-used projects such as Google Docs.
Brian
Brian, thanks. I've updated the answer.
Cheeso
+1  A: 

GitSharp includes a diff engine based on meyers diff. Take a look at the demo which implements a simple wpf diff viewer based on the Diff.Sections collection: http://www.eqqon.com/index.php/GitSharp#GitSharp.Demo

henon