# BeforeResourceStartedEvent

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/BeforeResourceStartedEvent.cs)
- Implements: [IDistributedApplicationEvent](/reference/api/csharp/aspire.hosting/idistributedapplicationevent.md), [IDistributedApplicationResourceEvent](/reference/api/csharp/aspire.hosting/idistributedapplicationresourceevent.md)

This event is raised by orchestrators before they have started a new resource.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class BeforeResourceStartedEvent
    : Aspire.Hosting.Eventing.IDistributedApplicationEvent,
      Aspire.Hosting.Eventing.IDistributedApplicationResourceEvent
{
    // ...
}
```

## ATS metadata

### ATS export

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

## Remarks

Resources that are created by orchestrators may not yet be ready to handle requests.

## Constructors

- [BeforeResourceStartedEvent(IResource, IServiceProvider)](/reference/api/csharp/aspire.hosting/beforeresourcestartedevent/constructors.md#constructor-iresource-iserviceprovider) -- This event is raised by orchestrators before they have started a new resource.

## Properties

- [Resource](/reference/api/csharp/aspire.hosting/beforeresourcestartedevent/properties.md#resource) : [IResource](/reference/api/csharp/aspire.hosting/iresource.md) `get` -- Resource associated with this event.
- [Services](/reference/api/csharp/aspire.hosting/beforeresourcestartedevent/properties.md#services) : `IServiceProvider` `get` -- The `IServiceProvider` instance.
