0

Web.Config? Website properties? I'm looking for suggestions/best practices with reasons you recommend them.

MGOwen
  • 5,951
  • 12
  • 51
  • 64

2 Answers2

3

The best way to version a project is to set the AssemblyVersion and AssemblyFileVersion attributes in this file:

AssemblyInfo.cs

The easiest way to set these is to use the property sheet for the project itself (right click the project file and choose "Properties"). On the first tab ("Application") click the "Assembly Information..." button and set the versions in the resulting dialog. These changes will be saved to the file I mentioned above.

Andrew Hare
  • 320,708
  • 66
  • 621
  • 623
  • OK, that looks like what I'm after, but my asp.net website doesn't have an AssemblyInfo.cs (nothing like that when right-clicking website properties either). Anyone know why and how to fix? This is a normal VS website, not a Web Application Project, and it used to be a .net 2.0 (and probably a 1.1 before that) solution, would that cause it? Should I try to put it in somewhere? – MGOwen May 25 '09 at 03:31
  • Well, then just add the AssemblyInfo.cs to your web site! – marc_s May 25 '09 at 04:56
  • Actually, there is also a Product Version specified by the [assembly: AssemblyInformationalVersion] attribute. http://all-things-pure.blogspot.com/2009/09/assembly-version-file-version-product.html – NightOwl888 Aug 30 '12 at 17:54
1

The easiest way to store application version information is via the AssemblyInfo.cs file. You can have this update automatically using something like the UpdateVersion utility in conjunction with a pre-build event (see this StackOverflow question for more details).

On a related note, I've got a blog entry which you might find useful, with details on how to build an ASP.NET About Page that can pull the information from the AssemblyInfo file into your web application along with details of other assemblies in the bin folder.

Community
  • 1
  • 1
Mun
  • 13,678
  • 8
  • 54
  • 82