githubEdit

Atom Host

The AtomHost class is the entry point for running any Atom-based application. It provides static methods to set up and execute your build definition, handling all the underlying infrastructure like dependency injection, configuration loading, and logging.

GenerateEntryPoint

Often, you won't even need to write the application entry point yourself.

By applying the [GenerateEntryPoint] attribute to your main build definition class, Atom will automatically generate a <file>.g.cs that calls AtomHost.Run<YourBuildDefinition>(args) for you.

// In your build definition project (e.g., Build.cs)
[BuildDefinition]
[GenerateEntryPoint] // This attribute tells Atom to generate Program.cs
public partial class MyBuild : BuildDefinition
{
    // ... your build definition ...
}

The following will be generated:

// <auto-generated/>

DecSm.Atom.Hosting.AtomHost.Run<MyBuild>(args);

AtomHost

The AtomHost class simplifies the process of getting your Atom build up and running. You typically interact with it through its Run method, which takes your build definition as a type parameter.

Run

If you already have a Program.cs file, you can simply add the following to create and run atom in one line:

CreateHostBuilder

Last updated

Was this helpful?