Working with LibCheck
(Page 1 of 4 )
In this fourth part to a multi-part series on code libraries, you'll learn how to use LibCheck. It is excerpted from chapter four of the book
Windows Developer Power Tools, written by James Avery and Jim Holmes (O'Reilly; ISBN: 0596527543). Copyright © 2006 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.
4.4 Finding Changes Between Assembly Versions with LibCheck
Assemblies may be changed many times throughout the life of a project due to the addition, removal, or modification of functionality. It is common to avoid upgrading to newer versions of an assembly when the code is shared within a company or throughout a community due to the fear of breaking changes.
With LibCheck, a team can compare the public interfaces of two assemblies to determine whether any interfaces have been removed, added, or modified. Viewing the differences between two versions can alert a development team to unintended consequences of their changes and alert the consumers of an upgraded assembly if there is potential for modifications to have an impact on their code.
LibCheck at a Glance
Tool | LibCheck |
Version covered | 1.0 |
Home page | http://www.microsoft.com/downloads/details.aspx? familyid=4B5B7F29-1939-4E5B-A780- 70E887964165&displaylang=en |
Power Tools page | http://www.windevpowertools.com/tools/145 |
Summary | Quickly get a picture of potentially breaking changes between assembly versions |
License type | Microsoft EULA |
Online resources | Blog |
Supported Frameworks | .NET 1.0, 1.1, 2.0 |
Related tools in this book | Reflector.Diff, Reflector |
Getting Started
LibCheck is available as a free download from Microsoft. The tool is distributed with the binaries, source code (C#), and tool-specification document. LibCheck is geared toward viewing breaking changes between versions of the .NET Framework, but it can be used to view breaking changes between any two assemblies.
To set up LibCheck, download the file from Microsoft and run the self-extracting executable to unzip it to the location you specify. You will find three files: EULA.rtf, LibCheck Tool Specification.doc, and libcheckfiles.zip. Unzip libcheckfiles.zip to find the Visual Studio 2003 solution, the projects and their accompanying source files, and the other files that are required to build the LibCheck solution. LibCheck’s executable has already been built, so you don’t need to build the tool unless you plan to make modifications.
The libcheck.sln file was built with Visual Studio 2003, but it is possible to open the solution with Visual Studio 2005 and allow the conversion wizard to convert the Visual Studio 2003 solution and projects to the new Visual Studio 2005 format.
If you are interested in running the 2003 version of LibCheck, you can simply copy the contents of the Debug\bin or Release\bin directories, or run LibCheck from the extracted bin directory.
LibCheck is a command-line executable, so it can easily be integrated into a NAnt or MSBuild project. To add LibCheck to an automated build process, simply call out to the LibCheck.exe executable with the appropriate arguments. The churn report generation process also generates an accompanying XML file with the results of the comparison. You can easily navigate this document with anXMLReaderor via XPath to determine whether there are any breaking changes.
Churn describes how much of the code base or library has changed between two assembly versions.
Next: Using LibCheck >>
More BrainDump Articles
More By O'Reilly Media
|
This article is excerpted from chapter four of the book Windows Developer Power Tools, written by James Avery and Jim Holmes (O'Reilly; ISBN: 0596527543). Check it out today at your favorite bookstore. Buy this book now.
|
|