---
title: "Assembly resolver scanner"
slug: "assembly-resolver-scanner"
abstract: "You can configure the number of assemblies Sitecore scans at start-up to make the start-up process faster."
---
# Assembly resolver scanner

Sitecore uses assembly resolvers to scan the assemblies for types at runtime. Type scanning large collections of assemblies can be a resource-intensive task. You can configure which assemblies to include and exclude from this scan. Excluding assemblies can decrease startup time.

You can use three different strategies scanning assemblies:

- Blacklist – loads all libraries except the ones listed in the `excludedAssemblies` node. Namespace: `Sitecore.Web.AssembliesScanner.ExcludedAssembliesConfiguration`.
- Whitelist – loads only the libraries listed in the `includedAssemblies` node. Namespace: `Sitecore.Web.AssembliesScanner.IncludedAssembliesConfiguration`.
- Mixed strategy – loads any whitelisted assembly that you have not blacklisted. Namespace: `Sitecore.Web.AssembliesScanner.MixedAssembliesConfiguration`.

You can also [create a custom strategy](https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-manager/assembly-resolver-scanner.html#UUID-0febfe2a-2a9d-f0e0-739c-97022bcd9d24_id__How_to_create "Create a custom strategy").

## Configure the inclusion and exclusion of assemblies

All assembly configuration is under the `configurationAssemblies` node. You specify the strategy that Sitecore uses by setting the type of this node, for example: `Sitecore.Web.AssembliesScanner.ExcludedAssembliesConfiguration, Sitecore.Web`.

### Exclude (blacklist) assemblies

Specify the assemblies in the `configurationAssemblies/excludedAssemblies` node that you want to exclude as a list of assembly names. Assembly names that start with a name contained in the `excludedAssemblies` list are not scanned.

You can add your solution assemblies to the list if you know they do not contain types that are scanned.

Example:

```xml
<excludedAssemblies hint="list">
    <excludedAssembly id="Antlr3.Runtime">Antlr3.Runtime</excludedAssembly>
    <excludedAssembly id="ComponentArt">ComponentArt</excludedAssembly>
    <excludedAssembly id="CsQuery">CsQuery</excludedAssembly>
    <excludedAssembly id="CustomFields">CustomFields</excludedAssembly>
</excludedAssemblies>

```

### Include (whitelist) assemblies

Specify the assemblies in the `configurationAssemblies/includedAssemblies` node that you want to include as a list of assembly names. Assembly names that start with a name in the `includedAssemblies` list are scanned.

Example:

```text
<includedAssemblies hint="list">    <includedAssembly id="Sitecore.Mvc">Sitecore.Mvc</includedAssembly>    <includedAssembly id="System.Web.Mvc">System.Web.Mvc</includedAssembly></includedAssemblies>

```

### Mixed strategy

You can use the mixed strategy to list `excludedAssemblies` and `includedAssemblies` at the same time.

The following examples shows what happens when you use a mixed strategy.

Example 1:

```xml
<excludedAssemblies hint="list">
    <excludedAssembly id="Sitecore.Mvc">Sitecore.Mvc</excludedAssembly>
</excludedAssemblies>
<includedAssemblies hint="list">
    <includedAssembly id="Sitecore.">Sitecore.</includedAssembly>
</includedAssemblies>

```

Result: Scans all of the `*Sitecore*.*` assemblies except `Sitecore.Mvc`.

Example 2:

```xml
<excludedAssemblies hint="list">
    <excludedAssembly id="Sitecore.Mvc">Sitecore.Mvc</excludedAssembly>
</excludedAssemblies>
<includedAssemblies hint="list">
    <includedAssembly id="Sitecore.Mvc">Sitecore.Mvc</includedAssembly>
</includedAssemblies>

```

Result: Scans no assemblies.

Example 3:

```xml
<excludedAssemblies hint="list">
    <excludedAssembly id="Sitecore.">Sitecore.</excludedAssembly>
</excludedAssemblies>
<includedAssemblies hint="list">
    <includedAssembly id="Sitecore.Mvc">Sitecore.Mvc</includedAssembly>
</includedAssemblies>

```

Result: Scans no assemblies.

## Patch the configuration

If you add a configuration similar to this example in an include file, for example `ExcludedAssembliesScanner.config`, Sitecore patches the original file with what you specify:

```xml
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <mvc>
            <configurationAssemblies type="Sitecore.Web.AssembliesScanner.ExcludedAssembliesConfiguration, Sitecore.Web">
                <excludedAssemblies hint="list">
                   <excludedAssembly id="MyTestWildCard1">MyTestWildCard1</excludedAssembly>
                   <excludedAssembly id="MyTestWildCard2">MyTestWildCard2</excludedAssembly>
                </excludedassemblies>
            </configurationAssemblies>
        </mvc>
    <sitecore>
</configuration>

```

All `excludedAssembly` nodes must have a unique ID.

## Create a custom strategy

Follow these steps to create a custom strategy:

1. Create a configuration class that inherits from the `AssembliesConfiguration` abstract class.
2. Override the `AssemblyFilter` property in this class. The property must return an instance of the filter class.
3. Create a filter class that implements `IAssemblyFilter`, and put all of the filter logic in the `IsAllowed` method.