SMath.Extensibility.Setup Namespace

 

Classes

DependencyVersion

Encapsulates a version or a version pattern which is used by DependencyVersionRange.

In contradistinction to System.Version, supports versions with single component like 3 and component wildcards like *, 1.*, 2.5.* or 1.7.4.*.

DependencyVersionRange

Describes a range of plug-in versions.

The format of string representation of the range is generally the same as for NuGet <PackageReference> element, see Version ranges in the NuGet documentation.

There are the following differences in behavior from NuGet:

  1. Semantic Versioning is not supported by DependencyVersionRange because plug-in versions are represented by the standard System.Version class and IComponentInfo.Version properties.

    Retrieval of plug-in version from AssemblyVersionAttribute and FileVersionInfo is also the reason why the ranges of versions are validated using only full 4-part versions. For example, version range [1.*, 1.0.0.0) is considered invalid on parse because it can denote only inconsistent range [1.0.0.0, 1.0.0.0) during load of the plug-in assemblies.

  2. Lower bound must always be specified in DependencyVersionRange and it must be inclusive, i.e., version ranges like (1.3.0, 2.0] or [,1.5] are considered invalid on parse.

    The reason of this behavior is NuGet Warning NU1604 which says that project dependency should contain an inclusive lower bound. In fact an inclusive lower bound always exists for dependencies between plug-ins because the actual version of dependency is resolved during compiltation of the depending plug-in.

    However, the use of pattern as inclusive lower bound is allowed: [1.*, 2.0) is considered a valid range.

  3. Infinite upper bound must be exclusive in DependencyVersionRange so ranges like [3.7,] are considered invalid on parse.

VersionValue Provides dedicated values for parts of Version and DependencyVersion.

Interfaces

IPluginComponentMetadata Contains general information about a plug-in component which is retrieved either from a metadata file in the plug-in package or from the loaded plug-in assembly.
IPluginDefaultMetadata Contains information about the plug-in that is known to the program by default.
IPluginDependency Describes a depdendency on a plug-in.
IPluginMetadata Contains general information about the main assembly of a plug-in which can be retrieved without loading the assembly.

Delegates

GetExistingPluginVersion Returns either the value of Version for existing plug-in or if the plug-in is missing.