How to "programmatically" integrate diff tool with Visual Studio

NullReferenceException

Is there a way to "programatically" integrate a diff tool (like WinDiff and WinMerge) with Visual Studio 2010? These files are not the files found at Solution Explorer.

The program would have to search and store in the List the files found from certain directory, and then compare the files with same names recursively.

Paul Michaels

As far as I can gather, you're looking for the TFS Difference class. Here's an example of how to use it:

string f1 = @"file1.cs";
string f2 = @"f2.cs";

Microsoft.TeamFoundation.VersionControl.Common.DiffOptions options = new Microsoft.TeamFoundation.VersionControl.Common.DiffOptions();
options.Recursive = true;
options.StreamWriter = new System.IO.StreamWriter(Console.OpenStandardOutput());
options.UseThirdPartyTool = true;
options.OutputType = Microsoft.TeamFoundation.VersionControl.Common.DiffOutputType.Unified;            

var diff = Difference.DiffFiles(
            f1, FileType.Detect(f1, null),
            f2, FileType.Detect(f2, null),
            options);

while (diff != null)
{
    // Do whatever it is that you want to do here            
    diff = diff.Next;
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to "programmatically" integrate diff tool with Visual Studio

From Dev

How to open a tool window of a visual studio extension programmatically?

From Dev

How to use Visual Studio (vsdiffmerge) as external diff tool in SourceTree for Mercurial?

From Dev

How to use an external diff tool for Git in Visual Studio 2013?

From Dev

How to use an external diff tool for Git in Visual Studio 2013?

From Dev

How to integrate projects in Visual Studio

From Dev

How to integrate ruby in Visual Studio 2010

From Dev

How to integrate starcounter with Visual Studio 2013

From Dev

Visual Studio 2015: Git Diff Tool Window is empty

From Dev

How to detect Visual Studio edition programmatically?

From Dev

How to integrate a custom antlr4-based language into Visual Studio

From Dev

How to integrate a custom Project Template and Wizard into Visual Studio package?

From Dev

How to integrate SAP Crystal Reports in Visual Studio 2015 Enterprise Edition

From Dev

How to integrate a custom Project Template and Wizard into Visual Studio package?

From Dev

Can I use WinMerge as my merge/diff tool within Visual Studio?

From Dev

How can I perform "Go To Definition" programmatically in Visual Studio?

From Dev

How to sort programmatically menu items added by VSIX Package in Visual Studio?

From Dev

How can I add an external tool to Visual Studio with a script or similar?

From Dev

How to get logs into the Tool Log in Release Management for Visual Studio

From Dev

How to add additional tool windows to a Visual Studio Extension?

From Dev

How to install mysql package for Visual Studio 2013 python tool

From Dev

How can I install Python tool for visual studio 2015?

From Dev

How to install mysql package for Visual Studio 2013 python tool

From Dev

Programmatically open file in visual studio

From Dev

Launch Visual Studio Code Programmatically

From Dev

How to integrate Akismet in wordpress/php programmatically

From Dev

Integrate Grunt with Visual Studio publish option

From Dev

How to see diff of each commit with Visual Studio Code?

From Dev

Integrate Visual Studio online Git Repository to Android Studio 1.0.2

Related Related

  1. 1

    How to "programmatically" integrate diff tool with Visual Studio

  2. 2

    How to open a tool window of a visual studio extension programmatically?

  3. 3

    How to use Visual Studio (vsdiffmerge) as external diff tool in SourceTree for Mercurial?

  4. 4

    How to use an external diff tool for Git in Visual Studio 2013?

  5. 5

    How to use an external diff tool for Git in Visual Studio 2013?

  6. 6

    How to integrate projects in Visual Studio

  7. 7

    How to integrate ruby in Visual Studio 2010

  8. 8

    How to integrate starcounter with Visual Studio 2013

  9. 9

    Visual Studio 2015: Git Diff Tool Window is empty

  10. 10

    How to detect Visual Studio edition programmatically?

  11. 11

    How to integrate a custom antlr4-based language into Visual Studio

  12. 12

    How to integrate a custom Project Template and Wizard into Visual Studio package?

  13. 13

    How to integrate SAP Crystal Reports in Visual Studio 2015 Enterprise Edition

  14. 14

    How to integrate a custom Project Template and Wizard into Visual Studio package?

  15. 15

    Can I use WinMerge as my merge/diff tool within Visual Studio?

  16. 16

    How can I perform "Go To Definition" programmatically in Visual Studio?

  17. 17

    How to sort programmatically menu items added by VSIX Package in Visual Studio?

  18. 18

    How can I add an external tool to Visual Studio with a script or similar?

  19. 19

    How to get logs into the Tool Log in Release Management for Visual Studio

  20. 20

    How to add additional tool windows to a Visual Studio Extension?

  21. 21

    How to install mysql package for Visual Studio 2013 python tool

  22. 22

    How can I install Python tool for visual studio 2015?

  23. 23

    How to install mysql package for Visual Studio 2013 python tool

  24. 24

    Programmatically open file in visual studio

  25. 25

    Launch Visual Studio Code Programmatically

  26. 26

    How to integrate Akismet in wordpress/php programmatically

  27. 27

    Integrate Grunt with Visual Studio publish option

  28. 28

    How to see diff of each commit with Visual Studio Code?

  29. 29

    Integrate Visual Studio online Git Repository to Android Studio 1.0.2

HotTag

Archive