Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should .NET Assembly names include a version number?

Tags:

.net

naming

We currently have a heated internal debate as to whether the actual .NET assembly name should include the code's version number (e.g. CodeName02.exe or CompanyName.CodeName02.dll). Does anyone know of an authoritative source, like Microsoft, that provides guidance on this issue?

like image 982
javacavaj Avatar asked Nov 21 '08 21:11

javacavaj


People also ask

What does a .NET assembly contain?

NET Framework, assemblies can contain one or more modules. This allows larger projects to be planned so that several developers can work on separate source code files or modules, which are combined to create a single assembly. For more information about modules, see How to: Build a multifile assembly.

Which component of the assembly stores the version number?

The version number is stored in the assembly manifest along with other identity information, including the assembly name and public key, as well as information on relationships and identities of other assemblies connected with the application.

Where do I put assembly version?

You can set the assembly version using the AssemblyVersionAttribute. Assembly attributes are usually applied in the AssemblyInfo.

What is assembly version in C#?

It's the version number used by framework during build and at runtime to locate, link, and load the assemblies.


1 Answers

This is what the Properties/AssemblyInfo.cs file is for.

There are two versions within that file, the file version and the assembly version:

[assembly: AssemblyVersion("1.1.0.256"]
[assembly: AssemblyFileVersion("1.1.0.256")]

Once these are set you can use them to track the versions of you binaries. It is easily viewed in explorer with right click->properties.

None of the dll or exe names included in Microsoft's applications (and OS) use that convention.

Other systems will use these numbers to resolve dependencies and verify the version. For example the MSI system will update binaries based on the version properties.

like image 92
csexton Avatar answered Sep 22 '22 20:09

csexton