Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Implementing automatic build number generation

  • Loading branch information...
commit 61f77a8ccad264033b7ccfb65cd4fe9acb4ca82b 1 parent ed2aa0b
@fraga fraga authored
View
8 NBlog.Lib/Properties/AssemblyInfo.cs
@@ -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.*")]
+
View
19 NBlog.Web/Application/Infrastructure/BuildNumberProvider.cs
@@ -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();
+ }
+ }
+}
View
4 NBlog.Web/Properties/AssemblyInfo.cs
@@ -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.*")]
View
5 NBlog.Web/Themes/Default/Views/_Layout.cshtml
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.