The physical form of the standard version number is a four-digit number separated by periods, as shown in the following figure. Code Example.
<Major version>. <minor version>. <build number>. <revision>
In actual use, we generally only use the first three paragraphs. That is
<Major version>. <minor version>. <build number>
The external version number and internal version number are also divided:
<Version>
<Internalver> 2.2.2 </internalver>
<Externalver> 1.1.0 </externalver>
</Version>
ProgramThe external version number is displayed.
Before the program is compiled, use the current internal version number to update the build number segment of the assemblyversion attribute. Non-program files (such as resources) use the internal version number during packaging, backup, and tagging.
Each assebmly contains three versions.
Assemblyfileversion: Stored in Win32 resources. CLR does not care about this version number,
Assemblyinformationnalversion: stored in Win32 resources. CLR does not care about this version number. This version number indicates that
Product Version of Assembly
Assemblyversion: Stored in assemblydef manifest metadata table. CLR uses this version number.
Tool support:
Csc.exeand al.exe can be automatically added at each build.AssemblyversionBut use it with caution. Change an assembly
AssemblyversionOther assemblies that reference this Assembly cannot work.
In vs, assemblyinfo. CS is generated for each. Net Porject. Relevant information can be set in it.
[Assembly:Assemblyversion("1.0.0.0")]
[Assembly:Assemblyfileversion("1.0.1.0")]
If you use [assembly:Assemblyversion("1. 0. *")], after each program build or rebuild
AssemblyversionThe build number and reversionnumber of will automatically increase. reversionnumber will be changed each time,
The build number varies with the date.
Is there any tool to explicitly setAssemblyversion?
Obtain the version information through the program:
// = Get file version
System. Diagnostics. fileversioninfo. getversioninfo
// = Get assembly version
Assemblyname assname = assembly. getexecutingassembly (). getname ();
String version = assname. version. tostring ();
For a Win32 EXE or DLL, you can view its properties (properties-> Version) in cmde.
File version
Product Version
A. Net assembly can view its properties (properties-> Version) in release E.
Assebly version (correspondingAssemblyversion)
File version (correspondingAssemblyfileversion)
Product Version (corresponding to assemblyinformationnalversion. If not specifiedAssemblyfileversionCorresponding)
VC version modification script
Sub Incresversion ()
'Description: Build active project and increase version counter in RC Script. map it to F7 for usage. (c) '98 th. Mahler
'Open the project' s resource script:
Documents. Open (Activeproject. Name + ". RC"), "text"
Windows (activeproject. Name + ". RC"). Active = True
'Find line with fileversion information:
Activedocument. selection. findtext "value" "fileversion" ",", dsmatchforward + dsmatchfromstart + dsmatchcase
'Move to EOL and then to end of build number:
Activedocument. selection. endofline
Activedocument. selection. charleft dsmove, 3
'Mark build number and store in strversion
Activedocument. selection. wordleft 1 'Dsextend does not work in my visualstudio ???
Dim Strversion
Strversion = activedocument. selection. Text
'Crease version and write back to file:
Activedocument. selection. replacetext strversion, strversion + 1
'Close RC file
Activedocument.Close ()
'Build active project
Executecommand "buildtogglebuild"
Documents. saveall True
End Sub
Source:
Http://recordsome.blogsome.com/2006/06/
Www.codeguru.com/cpp/v-s/devstudio_macros/article.php/c3183