# BeforePublishEvent

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Publishing`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/Publishing/BeforePublishEvent.cs)
- Implements: [IDistributedApplicationEvent](/reference/api/csharp/aspire.hosting/idistributedapplicationevent.md)

This event is published before the distributed application is published.

## Definition

```csharp
namespace Aspire.Hosting.Publishing;

public sealed class BeforePublishEvent
    : Aspire.Hosting.Eventing.IDistributedApplicationEvent
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting/BeforePublishEvent`
- Public instance properties are exported as ATS capabilities.

## Constructors

- [BeforePublishEvent(IServiceProvider, DistributedApplicationModel)](/reference/api/csharp/aspire.hosting/beforepublishevent/constructors.md#constructor-iserviceprovider-distributedapplicationmodel) -- This event is published before the distributed application is published.

## Properties

- [Model](/reference/api/csharp/aspire.hosting/beforepublishevent/properties.md#model) : [DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md) `get` -- The [DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md) instance.
- [Services](/reference/api/csharp/aspire.hosting/beforepublishevent/properties.md#services) : `IServiceProvider` `get` -- The `IServiceProvider` for the app host.
