I'm working on a Web Site solution (not a Web Application shame on me) in Visual Studio 2012 on a ASP.NET Web Forms (double shame on me) project. I would like to have an auto-increment version on each build so that I can retrieve it in my code and use for static files versioning (mostly css and js) to avoid chache it.
What I want to obtain are links like /mydir/mystyle.css?v=buildversionhere
I found a nice code to retrieve the version:
Dim web As Assembly = Assembly.GetExecutingAssembly()
Dim webName As AssemblyName = web.GetName()
Dim myVersion As String = webName.Version.ToString()
And it works, the problem is I always get 0.0.0.0. What I need to know is how to set an auto-increment on each website build, like where to set something like this:
[assembly:AssemblyFileVersion("1.0.*")]
Remember I'm on a Web Site project not on a Web Application. Thanks in advance