Class AssemblyDiscoveryHelper
Provides loading of application assemblies.
public static class AssemblyDiscoveryHelper
- Inheritance
-
objectAssemblyDiscoveryHelper
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
discoverableOnlyboolA 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.
- If the
discoverableOnlyis set totrue, assemblies without the AssemblyDiscoverableAttribute attribute are excluded from discovery. - If there is a file with the "exclude" extension, for example MyCustomAssembly.dll.exclude, the MyCustomAssembly.dll is excluded from discovery.
- 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
assembliesAssembly[]
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.