-1

If you go to:

Solution Explorer -- > Properties -- >(double click) Assembly Info

you will see some information about assemblies for your project. At the end of it there are some different versions for each assemblies that they are:

  1. Major Version
  2. Minor Version
  3. Build Number
  4. Revision

And I Understood that These are numbers of these:

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

but I don't understand the meaning.

Servy
  • 193,745
  • 23
  • 295
  • 406
  • 4
    Did you read the documentation for those attributes? http://msdn.microsoft.com/en-us/library/system.reflection.assemblyversionattribute.aspx and http://msdn.microsoft.com/en-us/library/system.reflection.assemblyfileversionattribute.aspx – Jon Skeet Jul 18 '13 at 17:29
  • http://stackoverflow.com/questions/3768261/best-practices-guidance-for-maintaining-assembly-version-numbers – Charlie Brown Jul 18 '13 at 17:30

4 Answers4

3

When the project is built those values are baked into the dll so that when you view the dll's properties via the Windows File System you will see that version number.

Managing those numbers is a bit of a pain in the ass. In older projects you'll often see some ugly build scripts that do things like check out the files then increment the number then check them in then continue with the build... The most elegant solution I've seen is implemented by TeamCity (though there are probably similar products); it basically copies all of the projects files to your build server, then it edits it's local copy with values it maintains (you can alter or reset them in UI), then builds the project. This allows it to never touch source control while giving you good control over dll versioning.

evanmcdonnal
  • 38,588
  • 13
  • 84
  • 107
1

They are whatever you want them to mean. You are free to use your own definitions for each section of the version number; beyond the fact that different numbers are different, there is no functionality driven off of this by the language.

Servy
  • 193,745
  • 23
  • 295
  • 406
1

AssemblyVersion is used in the strong name of the assembly(signing).

AssemblyFileVersion is displayed by Windows in the Version tab on the file properties.

AssemblyInformationalVersion is used in the assembly manifest for things like NuGet.

As far as how to version, I recommend Semantic Versioning, which uses a 3-part version number:

Given a version number MAJOR.MINOR.PATCH, increment the:
1. MAJOR version when you make incompatible API changes,
2. MINOR version when you add functionality in a backwards-compatible manner, and
3. PATCH version when you make backwards-compatible bug fixes.

Nicholas Carey
  • 60,260
  • 12
  • 84
  • 126
cadrell0
  • 16,215
  • 4
  • 48
  • 68
0

AssemblyVersion used for strong name of the assembly with sn.exe, but AssemblyFileVersion display the version on the file properties.

Aghilas Yakoub
  • 27,095
  • 4
  • 42
  • 47