Comme indiqué dans le fichier lui-même:
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
//[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
En changeant ce de la manière suivante:
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
Vous » Vous obtiendrez un auto-set des deux dernières sections (Build Number
et Revision
). Et cela fonctionne incrémentation automatique comme suit:
Build Number
: Jours depuis 1.1.2000
Revision
: secondes depuis minuit divisé par deux
Et last but not least, si vous utilisez Subversion pour SourceControl vous pouvez créer un fichier de modèle (copie du même fichier avec un autre nom) où vous remplacez un endroit comme ceci:
[assembly: AssemblyVersion("1.0.$WCREV$.0")]
et dans votre cas précompilés de votre projet, vous allez entrer dans quelque chose comme ceci:
SubWCRev "$(ProjectDir)\" "$(ProjectDir)Properties\AssemblyInfo.template.cs" "$(ProjectDir)Properties\AssemblyInfo.cs"
Pour obtenir votre numéro de révision de Subversion en cours dans les informations de version de votre application.
duplication possible de [Comment versionnez-vous vos projets?] (Http://stackoverflow.com/questions/142340/how-do-you-version-your-projects) –
son pas –