Permalink
Browse files

Implementing automatic build number generation

  • Loading branch information...
1 parent ed2aa0b commit 61f77a8ccad264033b7ccfb65cd4fe9acb4ca82b @fraga fraga committed Dec 27, 2011
@@ -31,6 +31,8 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+//[assembly: AssemblyVersion("1.0.0.0")]
+//[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.*")]
+//[assembly: AssemblyFileVersion("1.0.*")]
+
@@ -0,0 +1,19 @@
+using System.Reflection;
+
+namespace NBlog.Web.Application.Infrastructure
+{
+ /// <summary>
+ /// Provides current build number
+ /// </summary>
+ public static class BuildNumberProvider
+ {
+ /// <summary>
+ /// Returs
+ /// </summary>
+ /// <returns>A string containing Major, major rev, minor, minor rev and Revision</returns>
+ public static string GetBuildNumber()
+ {
+ return Assembly.GetExecutingAssembly().GetName().Version.ToString();
+ }
+ }
+}
@@ -31,5 +31,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.*")]
+//[assembly: AssemblyFileVersion("1.0.*")]
@@ -1,4 +1,5 @@
-@model NBlog.Web.Application.Infrastructure.LayoutModel
+@using System.Reflection
+@model NBlog.Web.Application.Infrastructure.LayoutModel
<!doctype html>
<html lang="en" class="no-js">
<head>
@@ -68,7 +69,7 @@
</div>
<footer class="text-links">
- Powered by <a href="http://chrisfulstow.com/nblog">NBlog</a>
+ Powered by <a href="http://chrisfulstow.com/nblog">NBlog</a> Build @BuildNumberProvider.GetBuildNumber()
</footer>
</div>

0 comments on commit 61f77a8

Please sign in to comment.