Elad Benda
Elad Benda

Reputation: 36656

Is there easy way to verify two dlls equality?

I have 2 dlls and 2 pdbs.

I want to verify their equality. Meaning they have the same content (no nessesarly same creation date)

Is there any easy freeware tool to do so?

Upvotes: 1

Views: 478

Answers (2)

UnhandledExcepSean
UnhandledExcepSean

Reputation: 12804

The easiest way to compare files to ensure the are identical is to you the file compare tool that comes with Windows. From the command window

fc /b file1 file2

Upvotes: 3

Darin Dimitrov
Darin Dimitrov

Reputation: 1038720

If by equality you mean same contents, you could calculate the SHA1 checksum of both files and compare the two hashes:

using(var cryptoProvider = new SHA1CryptoServiceProvider())
{
    byte[] buffer = File.ReadAllBytes("library1.dll");
    string hash = BitConverter.ToString(cryptoProvider.ComputeHash(buffer));
}

Upvotes: 2

Related Questions