Horst Walter
Horst Walter

Reputation: 14081

VS2010 Build number - easy way to generate it and display it in application

C# / VS2010

What is the easiest way to obtain a build number? I have noticed that when I PUBLISH a project, there is this publish version. Is there an equivalent to do something similar when just building - and not publishing.

Goal: I want to display an automatically updated version / build number in the application, so I need be able to fetch it at runtime - and of course somehow generate it.

Of course, I could write a little batch file doing things (pre-build). But isn't there something already available...

Upvotes: 0

Views: 8566

Answers (2)

angularconsulting.au
angularconsulting.au

Reputation: 28309

How to make Build Number in VS 2010 http://msdn.microsoft.com/en-us/library/aa395241.aspx

Also Build Version Add-In for Visual Studio http://autobuildversion.codeplex.com/

Upvotes: 1

karlis
karlis

Reputation: 920

use the version-number from your source-control-system. you can use a build task to get that number from the source-control and insert into the appropriate files.

Upvotes: 1

Related Questions