예제 #1
0
        static UmbracoVersion()
        {
            var umbracoCoreAssembly = typeof(UmbracoVersion).Assembly;

            // gets the value indicated by the AssemblyVersion attribute
            AssemblyVersion = umbracoCoreAssembly.GetName().Version;

            // gets the value indicated by the AssemblyFileVersion attribute
            AssemblyFileVersion = System.Version.Parse(umbracoCoreAssembly.GetCustomAttribute <AssemblyFileVersionAttribute>().Version);

            // gets the value indicated by the AssemblyInformationalVersion attribute
            // this is the true semantic version of the Umbraco Cms
            SemanticVersion = SemVersion.Parse(umbracoCoreAssembly.GetCustomAttribute <AssemblyInformationalVersionAttribute>().InformationalVersion);

            // gets the non-semantic version
            Current = SemanticVersion.GetVersion(3);
        }
예제 #2
0
    public UmbracoVersion()
    {
        Assembly umbracoCoreAssembly = typeof(SemVersion).Assembly;

        // gets the value indicated by the AssemblyVersion attribute
        AssemblyVersion = umbracoCoreAssembly.GetName().Version;

        // gets the value indicated by the AssemblyFileVersion attribute
        AssemblyFileVersion =
            Version.Parse(umbracoCoreAssembly.GetCustomAttribute <AssemblyFileVersionAttribute>()?.Version ??
                          string.Empty);

        // gets the value indicated by the AssemblyInformationalVersion attribute
        // this is the true semantic version of the Umbraco Cms
        SemanticVersion =
            SemVersion.Parse(umbracoCoreAssembly.GetCustomAttribute <AssemblyInformationalVersionAttribute>()
                             ?.InformationalVersion ?? string.Empty);

        // gets the non-semantic version
        Version = SemanticVersion.GetVersion(3);
    }