SaaS CMS has officially launched! Learn more now.

Class VersionUtility

Adapted Version utility, provides methods to get System.Runtime.Versioning.FrameworkName by folder name and find compatible assemblies.

Inheritance
System.Object
VersionUtility
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Shell.Modules
Assembly: EPiServer.Shell.dll
Version: 8.11.0
Syntax
public static class VersionUtility

Fields

NetFrameworkIdentifier

.NET framework indentifier

Declaration
public const string NetFrameworkIdentifier = ".NETFramework"
Field Value
Type Description
System.String

SilverlightIdentifier

Silverlight indentifier

Declaration
public const string SilverlightIdentifier = "Silverlight"
Field Value
Type Description
System.String

UnsupportedFrameworkIdentifier

Identifier for all unsupported frameworks

Declaration
public const string UnsupportedFrameworkIdentifier = "Unsupported"
Field Value
Type Description
System.String

UnsupportedFrameworkName

The unsupported framework value

Declaration
public static readonly FrameworkName UnsupportedFrameworkName
Field Value
Type Description
System.Runtime.Versioning.FrameworkName

Properties

DefaultTargetFramework

Gets the default target framework.

Declaration
public static FrameworkName DefaultTargetFramework { get; }
Property Value
Type Description
System.Runtime.Versioning.FrameworkName

The default target framework.

DefaultTargetFrameworkVersion

Gets the default target framework version.

Declaration
public static Version DefaultTargetFrameworkVersion { get; }
Property Value
Type Description
System.Version

Methods

IsCompatible(FrameworkName, FrameworkName)

Determines whether the specified framework name is compatible with target framework name.

Declaration
public static bool IsCompatible(FrameworkName frameworkName, FrameworkName targetFrameworkName)
Parameters
Type Name Description
System.Runtime.Versioning.FrameworkName frameworkName

Name of the framework.

System.Runtime.Versioning.FrameworkName targetFrameworkName

Name of the target framework.

Returns
Type Description
System.Boolean

true if the specified framework name is compatible; otherwise, false.

NormalizeVersion(Version)

Normalizes the version.

Declaration
public static Version NormalizeVersion(Version version)
Parameters
Type Name Description
System.Version version

The verison.

Returns
Type Description
System.Version

ParseFrameworkName(String)

This function tries to normalize a string that represents framework version names into something a framework name that the package manager understands.

Declaration
public static FrameworkName ParseFrameworkName(string frameworkName)
Parameters
Type Name Description
System.String frameworkName
Returns
Type Description
System.Runtime.Versioning.FrameworkName

TryGetCompatibleItems<T>(FrameworkName, IEnumerable<T>, out IEnumerable<T>)

Tries the get compatible module assemblies.

Declaration
public static bool TryGetCompatibleItems<T>(FrameworkName projectFramework, IEnumerable<T> items, out IEnumerable<T> compatibleItems)

    where T : ModuleAssembly
Parameters
Type Name Description
System.Runtime.Versioning.FrameworkName projectFramework

The project framework.

System.Collections.Generic.IEnumerable<T> items

The module assemblies.

System.Collections.Generic.IEnumerable<T> compatibleItems

The compatible modules assemblies.

Returns
Type Description
System.Boolean
Type Parameters
Name Description
T