Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do .NET assemblies ever change?

I have a need to provide a 32-bit CRC (Cyclic Redundancy Check) of all assemblies, which is stored (for release control purposes), and may then be compared against the assemblies present on a system at a later date (in order to check that the release hasn't been corrupted in some way).

I have no problem calculating the CRC of the assemblies themselves, my question is this:

Do .NET assemblies ever change? I.e. Does the actual binary content of the assembly ever change (for any reason) after it is installed on the target system? If it does, then the CRC would change also.

Note, I am referring only to assemblies that are packaged with my software, not the standard System assemblies, those are not checked.

Cheers

like image 519
Alistair Evans Avatar asked Jan 20 '10 11:01

Alistair Evans


People also ask

What is an assembly in .NET framework?

An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. Assemblies take the form of executable (.exe) or dynamic link library (. dll) files, and are the building blocks of . NET applications.

What is default type of dotnet assembly?

By default, assemblies are private. A private assembly is used only by a single application, and is stored in application folder, or in a subfolder. When the . net code gets compiled it generates an assembly which is stored in bin folder.

What is .NET assembly explain its types?

In the Microsoft . NET framework, an assembly is a partially compiled code library for use in deployment, versioning and security. There are two types: process assemblies (EXE) and library assemblies (DLL). A process assembly represents a process which will use classes defined in library assemblies. .

What are assemblies C#?

An assembly is a file that is automatically generated by the compiler upon successful compilation of every . NET application. It can be either a Dynamic Link Library or an executable file. It is generated only once for an application and upon each subsequent compilation the assembly gets updated.


2 Answers

You are re-inventing a wheel, strong naming already does this. Tampering an assembly so that it has the right CRC32 is pretty simple. Breaking a strong name is not, it is cryptographically secure.

like image 74
Hans Passant Avatar answered Sep 19 '22 16:09

Hans Passant


If you don't update the assemblies (overwrite them), they will never change.

like image 41
Philippe Leybaert Avatar answered Sep 17 '22 16:09

Philippe Leybaert