# ResourceStoppedEvent

- 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/ResourceStoppedEvent.cs)
- Implements: [IDistributedApplicationEvent](/reference/api/csharp/aspire.hosting/idistributedapplicationevent.md), [IDistributedApplicationResourceEvent](/reference/api/csharp/aspire.hosting/idistributedapplicationresourceevent.md)

This event is raised after a resource has stopped.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

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

## ATS metadata

### ATS export

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

## Remarks

This event allows for cleanup or unregistration logic when a resource is stopped by an orchestrator.

## Constructors

- [ResourceStoppedEvent(IResource, IServiceProvider, ResourceEvent)](/reference/api/csharp/aspire.hosting/resourcestoppedevent/constructors.md#constructor-iresource-iserviceprovider-resourceevent) -- This event is raised after a resource has stopped.

## Properties

- [Resource](/reference/api/csharp/aspire.hosting/resourcestoppedevent/properties.md#resource) : [IResource](/reference/api/csharp/aspire.hosting/iresource.md) `get` -- Resource associated with this event.
- [ResourceEvent](/reference/api/csharp/aspire.hosting/resourcestoppedevent/properties.md#resourceevent) : [ResourceEvent](/reference/api/csharp/aspire.hosting/resourceevent.md) `get` -- The [ResourceStoppedEvent.ResourceEvent](/reference/api/csharp/aspire.hosting/resourcestoppedevent/properties.md#resourceevent) containing the current state information.
- [Services](/reference/api/csharp/aspire.hosting/resourcestoppedevent/properties.md#services) : `IServiceProvider` `get` -- The `IServiceProvider` instance.
