auto incrementation of assembly

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 9
Reputation: mrkcse is an unknown quantity at this point 
Solved Threads: 0
mrkcse mrkcse is offline Offline
Newbie Poster

auto incrementation of assembly

 
0
  #1
Nov 5th, 2008
hi all,
here i got strucked on auto incrementation of version using c# ,iam trying to do it programatically but i could able to change version number in variables but iam not able to write it back as it is read only.Is there any alternative for this?.

my code is as follows.


  1. string versionnum;
  2. int rev;
  3. int major;
  4. int minor;
  5. int build;
  6. Assembly assem = Assembly.GetExecutingAssembly();
  7. AssemblyName assemName = assem.GetName();
  8. applicationVersion = assemName.Version;
  9.  
  10. major = Convert.ToInt32(applicationVersion.Major);
  11. minor = Convert.ToInt32(applicationVersion.Minor);
  12. build = Convert.ToInt32(applicationVersion.Build);
  13. rev = Convert.ToInt32(applicationVersion.Revision) + 1;
  14. versionnum = major+"."+minor+"." + build + "." + rev;
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: auto incrementation of assembly

 
0
  #2
Nov 5th, 2008
You should be changing the version in the compile, not at runtime. Versions are read only at runtime.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: auto incrementation of assembly

 
0
  #3
Nov 5th, 2008
think you got your revision number hardcoded probably if its not changing, take a look at your assemblyinfo.cs file

you can do this get revision to change automatically

  1. [assembly: AssemblyVersion("1.1.1.*")]
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 9
Reputation: mrkcse is an unknown quantity at this point 
Solved Threads: 0
mrkcse mrkcse is offline Offline
Newbie Poster

Re: auto incrementation of assembly

 
0
  #4
Nov 6th, 2008
Please anyone tell me how to increment version no at compile time.

I have tried by placing following line in assemblyinfo.cs file still its not working
  1. [assembly: AssemblyVersion("1.0.0.*")]
Last edited by mrkcse; Nov 6th, 2008 at 12:21 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: auto incrementation of assembly

 
0
  #5
Nov 6th, 2008
that one changes revision btw

also check the same for

  1. AssemblyFileVersion

you can look at it in
Project -> Properties ->Application -> Assembly Information

also if you really feel lazy you can use this add in
http://www.codeproject.com/KB/macros/vsautover.aspx
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 9
Reputation: mrkcse is an unknown quantity at this point 
Solved Threads: 0
mrkcse mrkcse is offline Offline
Newbie Poster

Re: auto incrementation of assembly

 
0
  #6
Nov 6th, 2008
Thanks for the replies, i got the solution. Actually it is incrementing but in my application more than one dll we are using,it is pointing to other dll. so , i have taken primary output assembly version and now it is giving inremented version no everytime.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC