StrataFrame Forum

automaticly increase assembly version number of classlibrary

http://forum.strataframe.net/Topic18054.aspx

By Philipp Guntermann - 7/24/2008

Hi,

does anyone know a way to accomplish, that VS automaticly increases the assembly version number of my class library,

with each build ?

Thanks.

By Ralph Rutschmann - 7/24/2008

Hi,

open your solution in VS, click Project than  Properties at the menu, then click the tab down left named 'deploy', I guess. There is a checkbox down left at the page which you should activate if it is not.

Sorry, I use the german version of VS but my translation should give you a hint.

HTH,

Ralph

By Ralph Rutschmann - 7/24/2008

Sorry, should have written: 'click Project _then_ Properties at the menu'

Ralph

By Philipp Guntermann - 7/24/2008

i dont have the "deploy" tabs with a classlibrary project. only with normal (winform) projects.
By Philipp Guntermann - 7/24/2008

here's a screenshot:

By Trent L. Taylor - 7/25/2008

You will set this within the AssemblyInfo.vb or AssemblyInfo.cs class that is within your project.  It will appear under the My project or Properties folders within the solution.  Once open, you will just set the AssemblyVersion tag to include wild cards on the last item:

assembly: AssemblyVersion("1.0.*")

You can also do this ver same thing by right-clicking the project, going to the Application page, then clicking the Assembly information button.  Just put a * in the 3rd place and leave the 4th blank.

By Philipp Guntermann - 7/25/2008

hi,

thanks. it works. :BigGrin

however it will only show the new version number when i right-click the file and select properties->version

but not under the file name in windows explorer. there it shows some number i gave it before. i have no idea where it pulls that from. any idea ?

thanks !

By Philipp Guntermann - 7/25/2008

ok apearantly it takes that from the AssemblyFileVersion and the windows explorer doesnt refresh it correctly.

however i cannot apply * to the AssemblyFile-Version. It also gives me a warning in the debugger.

By Philipp Guntermann - 7/25/2008

ok, thanks i got it BigGrin

just had to remove it from the assemblyInfo.cs

cool BigGrin

By StrataFrame Team - 7/25/2008

Excellent, glad you got it working.  BTW, just FYI, when you reference the class library as a project (meaning it's in the same solution), you won't have a problem.  However, if you try to reference the class library as an assembly reference (by browsing to the .dll on disk when you add the reference), then you'll need to set the "Specific Version" option to "false" to make sure that your referencing project doesn't lose its reference each time you build the class library.
By Philipp Guntermann - 7/25/2008

Ben Chase (07/25/2008)
Excellent, glad you got it working.  BTW, just FYI, when you reference the class library as a project (meaning it's in the same solution), you won't have a problem.  However, if you try to reference the class library as an assembly reference (by browsing to the .dll on disk when you add the reference), then you'll need to set the "Specific Version" option to "false" to make sure that your referencing project doesn't lose its reference each time you build the class library.

ah. allright BigGrin

will make sure i do that. thanks !