# Windsor: Loading installers from the execution folder

- Link: https://saguiitay.com/windsor-loading-installers-from-the-execution-folder/
- Published: 2011-09-10T13:52:00+03:00
- Author: Itay

When using Windsor, it is necessary to load the various IWindowsInstallers into 
the container. One standard way of doing this is using a code similar to the below:

    ```notranslate
    container.Install(FromAssembly.InDirectory(new AssemblyFilter(".")));
    ```

The above code will load all the Installers that are located in the execution folder.

However, in certain cases, when your code is running in different contexts, such
as under IIS, you need to be a bit more explicit about things. You need to tell 
Windsor to load assemblies from the folder where you are running, and not from some
run-time copy or cache folder.

For that, you can use the following class:

    ```notranslate
    public class ExecutingAssemblyFilter : AssemblyFilter
    {
        public ExecutingAssemblyFilter()
            : base(new FileInfo(new Uri(Assembly.GetExecutingAssembly).CodeBase).LocalPath).Directory.ToString())
        { }
    }
    ```

This class inherits from `AssemblyFilter`, and automatically provides the correct
path. It should be used like this:

    ```notranslate
    container.Install(FromAssembly.InDirectory(new ExecutingAssemblyFilter()));
    ```

### _Related_
