Class AssemblyExtension
Extension methods to simplify working with assemblies
Inheritance
Namespace: EPiServer.Framework.Initialization
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
public static class AssemblyExtension : ObjectMethods
IsDynamicAssembly(Assembly)
Determines whether the specified assembly is a dynamically generated assembly.
Declaration
public static bool IsDynamicAssembly(this Assembly assembly)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Reflection.Assembly | assembly | The assembly to check. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
Remarks
This extension method checks more than just the IsDynamic property, which does not cover all relevant cases of dynamic assemblies.
IsEPiServerSignedAssembly(Assembly)
Determines whether the specified assembly is signed by EPiServer. This method is used to determine if an assembly is a part of EPiServer products family.
Declaration
public static bool IsEPiServerSignedAssembly(this Assembly assembly)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Reflection.Assembly | assembly | The assembly. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
IsNetFrameworkAssembly(Assembly)
Determines whether the specified assembly is a .NET Framework assembly.
Declaration
public static bool IsNetFrameworkAssembly(this Assembly assembly)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Reflection.Assembly | assembly | The assembly to check. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
IsSameAssemblyName(AssemblyName, AssemblyName)
Compares assembly names based on name and public key token. Returns true if name and public key token of this assembly are equal.
Declaration
public static bool IsSameAssemblyName(this AssemblyName assemblyName, AssemblyName assemblyName2)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Reflection.AssemblyName | assemblyName | The assembly name. | 
| System.Reflection.AssemblyName | assemblyName2 | The assembly name for comparison. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
IsScanAllowed(Assembly)
Determines whether the specified assembly is allowed for type/attribute scanning.
Declaration
public static bool IsScanAllowed(this Assembly assembly)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Reflection.Assembly | assembly | The assembly to check. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
Remarks
Any dynamic or .NET Framework assembly will be excluded, as well as any assembly that contains the [PreventAssemblyScan] attribute.
NormalizedName(Assembly)
Normalizes the assembly name.
Declaration
public static string NormalizedName(this Assembly assembly)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Reflection.Assembly | assembly | The assembly. | 
Returns
| Type | Description | 
|---|---|
| System.String | A normalized version of the assembly display name. | 
