Gets the version information as read from the "AssemblyInfo.cs" file.

using System;
using System.Configuration;
using System.Diagnostics;
using System.Reflection;

namespace Helpers
{
    public static class AssemblyVersionHelper
    {
        private const string environmentConfigKey = "environment";

        static VersionHelper()
        {
            var assembly = Assembly.GetExecutingAssembly();
            var version = assembly.GetName().Version;

            // semantic versioning
            Version = string.Format("{0}.{1}.{2}",
                version.Major,
                version.Minor,
                version.Build
            );

            if (assembly.Location != null)
            {
                ProductVersion = FileVersionInfo.GetVersionInfo(
                    assembly.Location).ProductVersion;
            }

            AppEnvironment = ConfigurationManager.AppSettings[environmentConfigKey];
        }

        static public string Version { get; private set; }
        static public string ProductVersion { get; private set; }
        static public string Environment { get; private set; }
    }
}