![]() |
Languages »
C# »
Utilities
Intermediate
License: The Code Project Open License (CPOL)
Versioner: An AssemblyInfo version incrementerBy PIEBALDconsultA simple C# program that will increment the AssemblyVersion attribute of an AssemblyInfo.cs file. |
C#, Windows, .NET2.0VS2005, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
AssemblyVersion attributes of AssemblyInfo.cs files look something like these:
[assembly: System.Reflection.AssemblyVersion("1.0.0.0")]
[assembly: System.Reflection.AssemblyVersion("1.0.0.*")]
[assembly: System.Reflection.AssemblyVersion("1.0.*.*")]
The asterisks in the second and third examples will cause the compiler to set those two fields, but the values used may not be very useful. If you want useful values, you need to use the first example and set them yourself, but that can be a bit tedious.
This little program of mine will find an AssemblyVersion attribute in the specified file (if one exists) and attempt to increment its fourth field by one. You will still need to set the other fields manually, but that's just the nature of the beast.
Compile Versioner.cs with your choice of C# compiler.
To run it, use:
Versioner AssemblyInfo.cs
Such a command may be added to a Visual Studio project as a "Pre-build event", this will cause the version to be incremented automatically when the project gets built.
| You must Sign In to use this message board. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads.
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 9 Jun 2006 Editor: Smitha Vijayan |
Copyright 2006 by PIEBALDconsult Everything else Copyright © CodeProject, 1999-2010 Web22 | Advertise on the Code Project |