SharpLife.NET
A sharp way to know more // Mahdi Taghizadeh's Daily Web Keystrokes.
Navigation for SharpLife.NET - Auto Increment Assembly Version
Content
Sidebar
Footer
May 9, 2006
@ 02:10 PM
Comments [6]
Auto Increment Assembly Version
You have seen a file named "AssemblyInfo.cs (or .vb according to your programming language)" in your projects. This file contains information about the output assembly of your project such as Author's Name, Copyright Notice, ... and Assembly Version. By default assembly version is set to 1.0.0.0. This version declaration shows major.minor.build.revision numbers of your assembly. Two first numbers are commonly constant e.g. 2.0. Third number follows YYMMDD rule (of build date) and the last number is build counter.
It is a good idea to change assembly version and use it in your application. For example you can show Application Version to the end user. It's so easy, take a look:
Assembly
assembly =
Assembly
.GetExecutingAssembly();
string
version = assembly.GetName().Version.ToString();
But one thing that I was interested in was "How to tell Visual Studio 2005 change assembly version in an auto increment behavior?"
After I googled this issue I found a
solution
on MSBuild Team
Blog
. They built an
AssemblyInfoTask
on GotDotNet.com. It's so easy to be integrated in your project. Just download the required package and run it. It will install AssemblyInfoTask in your GAC or Application Data folder (depending on your choice). Then you should add this single line of code to your project file after last
<Import>
tag:
<
Import
Project
=
"
$(MSBuildExtensionsPath)\Microsoft\AssemblyInfoTask\Microsoft.VersionNumber.targets
"
/>
or this one (if you installed it in Data Application folder):
<
Import
Project
=
"
$(APPDATA)\Microsoft\MSBuild\AssemblyInfoTask\Microsoft.VersionNumber.Targets
"
/>
Everything is done now! Your Assembly Version will change automatically based on the rules I said before.
Because Setup file and updated help file of this project are located on GotDotNet.com and you should login to this site and also join this project to download them, I uploaded Setup package and updated Help file for you. Find them below:
Downlod:
Setup Package
|
Updated Help File
Categories:
Download
|
Microsoft
|
.NET General
Related posts:
Find Your Web site SQL Injection Vulnerabilities Using Scrawlr
How to use ASP.NET Membership in a Console Application
Download .netTiers Documentation
reCAPTCHA: Free CAPTCHA Solution For Your Website
Some ASP.NET Articles
BlogEngine.NET 1.2 Released
« CSS Adapter for ASP.NET 2.0
|
Home
|
Stars of Persia! »
Tuesday, May 09, 2006 5:02:25 PM (Iran Standard Time, UTC+03:30)
You can also simply set the AssemblyVersion attribute to "x.y.*" or "x.y.z.*".
Soheil
Tuesday, May 09, 2006 6:03:57 PM (Iran Standard Time, UTC+03:30)
After seconding what Soheil pointed, I should say that this isn't what I do. It's better if you do it manually in AssemblyInfo.cs because when you contribute a project on a server based compilation for a team, you need to update the version in some regular steps ;-)
Keyvan Nayyeri
Tuesday, May 09, 2006 10:17:41 PM (Iran Standard Time, UTC+03:30)
And never even think of auto incrementing version number of a strongly-named shared assembly.
Soheil
Tuesday, May 15, 2007 5:25:40 PM (Iran Standard Time, UTC+03:30)
I think manual is the better approach.
soma online
Tuesday, May 15, 2007 5:26:16 PM (Iran Standard Time, UTC+03:30)
There must be a more elegant way to handle that.
cheap carisoprodol
Tuesday, May 15, 2007 5:26:50 PM (Iran Standard Time, UTC+03:30)
I can just wait and see how this turns out.
wellbutrin
Comments are closed.
Special
Tabassom's Photo Gallery
Contact
Email me!
RSS/Subscribe
Subscribe in a reader
Archives
All dates
All Posts
Microblog/MicroSharpLife!
Search
Latest Posts
Laptopical.com, The Laptops Weblog!
Find Your Web site SQL Injection Vulnerabilities Using Scrawlr
How to use ASP.NET Membership in a Console Application
Follow my tiny posts on twitter too!
Joint Song by Arian Music Band and Chris De Burgh
Download .netTiers Documentation
Jaiku Invitations
reCAPTCHA: Free CAPTCHA Solution For Your Website
Categories
.NET General (11)
AJAX (10)
ASP.NET (18)
C# (3)
Celebrities (1)
Community Server Persian (1)
dasBlog (1)
Download (19)
General (6)
i18n (4)
Iran (5)
Mathematics (1)
Microsoft (8)
Music (1)
Notebook (1)
Other (6)
Personal (11)
Politics (1)
Review (1)
Security (6)
SharpLife.NET (5)
Smart Phone (2)
Software (6)
Sports (3)
SQL Server (1)
Tabassom (2)
Tools (5)
Training (1)
Web (8)
Web 2.0 (7)
Web Development (9)
Web Services (3)
Archives
August, 2008 (1)
July, 2008 (2)
June, 2008 (1)
November, 2007 (2)
October, 2007 (4)
September, 2007 (14)
August, 2007 (5)
May, 2006 (4)
April, 2006 (6)
March, 2006 (5)
February, 2006 (20)
January, 2006 (2)
BlogRoll
Alireza Esmaeili
Behnam Youssefi
Farid Arzpeyma
Keyvan Nayyeri
Meysam Jafarinezhad
Nima Shayafar
Pedram Pourhossein
Reza Hashemi
Sassan Yeganegi
Scott Hanselman
Shima Dehbashi
Tabassom Taghizadeh
See my little daughter photos.
Categories
.NET General
AJAX
ASP.NET
C#
Celebrities
Community Server Persian
dasBlog
Download
General
i18n
Iran
Mathematics
Microsoft
Music
Notebook
Other
Personal
Politics
Review
Security
SharpLife.NET
Smart Phone
Software
Sports
SQL Server
Tabassom
Tools
Training
Web
Web 2.0
Web Development
Web Services
BlogRush