user433731
user433731

Reputation: 73

Compare 2 versions of a .NET assembly?

How to compare 2 versions of a compiled .NET assembly to see changes between the 2 versions? I have a library not well-documented and I need to know what has been changed between the old version and the new version.

Upvotes: 7

Views: 2653

Answers (5)

Patrick from NDepend team
Patrick from NDepend team

Reputation: 13842

The tool NDepend offers many features to handle .NET code diff. Disclaimer: I am one of the developer of the tool.

The panel Search by Change is dedicated to browse assemblies code diff. Notice that:

  • You can plug to NDepend any code diff tool used by the menu Compare older and newer version of source file
  • If you don't have the source code, only the raw assemblies, there is the option Compare older and newer version disassembled with Reflector

NDepend Search by Diff Panel

Notice also in the screenshot that a CQLinq code query is generated to browse the diff.

from m in Application.Methods 
where m.CodeWasChanged() 
select new { m, m.NbLinesOfCode }

Many others default diff queries and rules are proposed by default, that will let you browse .NET code diff in a smart way.

Upvotes: 3

Kangkan
Kangkan

Reputation: 15571

Do you have the code or just the assemblies? In case you have the compiled versions, one way is to dig into them using the object browser in visual Studio. The other approach might be using disassembler like Red Gates Reflector to see to the source code.

Upvotes: 0

Mikael Koskinen
Mikael Koskinen

Reputation: 12926

In addition to Reflector, you can use NDepend to perform this task. Please note that this is a commercial software, but the site offers a free trial. Here's an online tutorial on how one can use NDepend to compare two assemblies.

Upvotes: 4

kbrimington
kbrimington

Reputation: 25692

I use reflector, with the Diff plugin.

You might also find this Hanselman post useful, as it reviews other tools, including Reflector Diff.

http://www.hanselman.com/blog/ManagingChangeWithNETAssemblyDiffTools.aspx

Upvotes: 1

fletcher
fletcher

Reputation: 13800

Use Red Gate's .NET reflector and you'll be able to take a look at the actual code changes between the assemblies.

Upvotes: 1

Related Questions