i have developed the windows application in visual studio 2010 with C#. i am using visual source safe 2005 as the version controller. in my application have about us forms which contains the build version no and build date. my client asked me in every build the version no and date update automatically. currently i am updating manually. help me in this issue.

- 35,463
- 9
- 80
- 98

- 1
- 1
-
1Sourcesafe is no longer a supported product (http://blogs.msdn.com/b/ukmsdn/archive/2011/01/04/end-of-support-for-visual-sourcesafe.aspx). Microsoft provides a free version of Team Foundation Server for up to 5 users as a replacement. I'd seriously consider using that (or the Team Foundation Service, or something like GitHub). – jessehouwing Apr 03 '13 at 13:06
1 Answers
This has nothing to do with SourceSafe per se, since it's only used to store the code, it doesn't build nor act upon it.
You can create an automatically incrementing version number for your assemblies by using the [AssemblyFileVersion("1.2.*")]
attribute and by specifying a wildcard.
If you want to include a build date, you'll need to use a pre-build task in your .csproj file which will update the date inside a .cs file before the code is built.
Alternatively you can use a post-build task to create a xml or text file containing the build date (and even version if you want to), then when you need to display the information, you can pull it from said file.
A RegexReplace task might help you out here... Or the UpdateFile task. Be weary of the hosted environment when using a task to patch .cs files just before build. The MsBuild Community Tasks can be your friend here.

- 1
- 1

- 106,458
- 22
- 256
- 341