Table of Contents

Class AssemblyDiscoveryHelper

Namespace
CMS.Core
Assembly
CMS.Core.dll

Provides loading of application assemblies.

public static class AssemblyDiscoveryHelper
Inheritance
object
AssemblyDiscoveryHelper

Remarks

This API supports the framework infrastructure and is not intended to be used directly from your code.

Methods

GetAssemblies(bool)

Returns an enumerable collection of application assemblies.

public static IEnumerable<Assembly> GetAssemblies(bool discoverableOnly)

Parameters

discoverableOnly bool

A value indicating whether the discovery process will locate only assemblies decorated with the AssemblyDiscoverableAttribute attribute.

Returns

IEnumerable<Assembly>

An enumerable collection of application assemblies.

Remarks

The discovery process looks for assemblies in the directories that the assembly resolver probes. By default, all the application assemblies are returned, but there are exceptions.

  1. If the discoverableOnly is set to true, assemblies without the AssemblyDiscoverableAttribute attribute are excluded from discovery.
  2. If there is a file with the "exclude" extension, for example MyCustomAssembly.dll.exclude, the MyCustomAssembly.dll is excluded from discovery.
  3. Assemblies from the GAC are always excluded from discovery.

RegisterAdditionalAssemblies(params Assembly[])

Register additional assemblies for which module discovery will execute.

public static void RegisterAdditionalAssemblies(params Assembly[] assemblies)

Parameters

assemblies Assembly[]

Remarks

This method is not intended to be used in custom code.

Assemblies have to be registered before application pre-init.

Exceptions

InvalidOperationException

Thrown when method is called after application pre-init.