samedi 26 avril 2014

Visual studio 2010 - ne peut pas trouver un bon moyen propre à la version du fichier incrément avec chaque version Release en vs2010 - Stack Overflow


I have this sample configuration in my assemblyinfo file.


// 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("3.1.0.*")]
[assembly: AssemblyFileVersion("3.1.0.0")]

Once I rebuild, I get this:


Fileversion: 3.1.0.0 Product version: 3.1.0.0


What I would like is the product version to be static, this is already fine, but I would like the file version to automatically increment, is this possible?


Assembly version is good for technical analysis, but file version is an NTFS property visible by right clicking the file in windows explorer, so customers and consultants can get an idea of the version without using a 3rd party tool.




Annoyingly (however probably on purpose) the * in the assembly version attributes only works if applied to the last two, not just the final one:


[assembly: AssemblyVersion("3.1.*")]
// [assembly: AssemblyFileVersion("3.1.*")] - I take it back, this doesn't work.

If you want to increment the revision number without breaking .Net references then I suggest that you use the assembly file version rather than the assembly version, and increment the assembly version manually whenever you decide its necessary.


The only alternative would be a 3rd party add-in or external process.


(It seems that I was wrong - the * syntax only works on the assembly version not the file assembly version.)




Looks like someone had the same issue, and the resolution is to comment out the 'AssemblyFileVersion' attribute, and it will take the value of the 'AssemblyVersion' which should work for you.


Assembly File Version not changing?
http://stackoverflow.com/questions/1158252/assembly-file-version-not-changing



I have this sample configuration in my assemblyinfo file.


// 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("3.1.0.*")]
[assembly: AssemblyFileVersion("3.1.0.0")]

Once I rebuild, I get this:


Fileversion: 3.1.0.0 Product version: 3.1.0.0


What I would like is the product version to be static, this is already fine, but I would like the file version to automatically increment, is this possible?


Assembly version is good for technical analysis, but file version is an NTFS property visible by right clicking the file in windows explorer, so customers and consultants can get an idea of the version without using a 3rd party tool.



Annoyingly (however probably on purpose) the * in the assembly version attributes only works if applied to the last two, not just the final one:


[assembly: AssemblyVersion("3.1.*")]
// [assembly: AssemblyFileVersion("3.1.*")] - I take it back, this doesn't work.

If you want to increment the revision number without breaking .Net references then I suggest that you use the assembly file version rather than the assembly version, and increment the assembly version manually whenever you decide its necessary.


The only alternative would be a 3rd party add-in or external process.


(It seems that I was wrong - the * syntax only works on the assembly version not the file assembly version.)



Looks like someone had the same issue, and the resolution is to comment out the 'AssemblyFileVersion' attribute, and it will take the value of the 'AssemblyVersion' which should work for you.


Assembly File Version not changing?
http://stackoverflow.com/questions/1158252/assembly-file-version-not-changing


0 commentaires:

Enregistrer un commentaire