Logic behind [Autostart]?

I’m setting up a few events around my code. It all works fine and is very convenient, but since am completely new to c# I’m wondering how does the system know to parse my files and run the register my events?
Is [Autostart] the magic? And is this annotation core c# functionality, or is this a Litium thing?

[Autostart]
public class EventBrokerOrders : IDisposable
{
 }

Litium version: 6.2

The AutostartAttribute is a Litium-thing that during the startup phase checking all assemblies and all classes that is decorated with the attribute will be created. One part to think of is that the creation of the class with the [Autostart] is executed before next operation can continue and if the ctor of the class will take long time it will reflect in the startup performance. The attribute is in the new API structure and is executed before the legacy part of the application is started. So if the classes will have a dependence on any of the legacy areas they will fail.

In Litium we have some other interfaces that can be used to automatic execute code in different phase of the startup, they exists in the namespace Litium.Owin.Lifecycle, the Application class in this namespace will have the following documentation that have the order and all the different interfaces that should be used in the project.

    /// During startup the process will fire different tasks in different step, the order the tasks are executed in are:
    /// <see cref="IPreSetupTask" />, <see cref="ISetupTask" />,
    /// <see cref="IPostSetupTask" />, <see cref="IStartupTask" /> and <see cref="IStartupTaskAsync" />. The startup
    /// process are running all except the <see cref="IStartupTaskAsync" />
    /// in synchronous and before returning that the application are started the <see cref="IStartupTaskAsync" /> are
    /// started.
    /// When application should be stopped the <see cref="Stop" /> should be executed, that will execute all the
    /// <see cref="IReleaseTask" /> that are registered.

And you have another way that will be setup in web.config that we have here https://docs.litium.com/documentation/get-started/configure/web_config#tasks
The interface that should be implemented for them is Litium.Foundation.Tasks.ITask