# IDistributedApplicationLifecycleHook

- Kind: `interface`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.Lifecycle`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Lifecycle/IDistributedApplicationLifecycleHook.cs)

Defines an interface for hooks that are executed during the lifecycle of a distributed application.

## Definition

```csharp
namespace Aspire.Hosting.Lifecycle;

public interface IDistributedApplicationLifecycleHook
{
    // ...
}
```

## Methods

- [AfterEndpointsAllocatedAsync(DistributedApplicationModel, CancellationToken)](/reference/api/csharp/aspire.hosting/idistributedapplicationlifecyclehook/methods.md#afterendpointsallocatedasync-distributedapplicationmodel-cancellationtoken) : `Task` `virtual` -- Executes after the orchestrator allocates endpoints for resources in the application model.
- [AfterResourcesCreatedAsync(DistributedApplicationModel, CancellationToken)](/reference/api/csharp/aspire.hosting/idistributedapplicationlifecyclehook/methods.md#afterresourcescreatedasync-distributedapplicationmodel-cancellationtoken) : `Task` `virtual` -- Executes after the orchestrator has created the resources in the application model.
- [BeforeStartAsync(DistributedApplicationModel, CancellationToken)](/reference/api/csharp/aspire.hosting/idistributedapplicationlifecyclehook/methods.md#beforestartasync-distributedapplicationmodel-cancellationtoken) : `Task` `virtual` -- Executes before the distributed application starts.
