# AspireStoreExtensions Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [AspireStoreExtensions](/reference/api/csharp/aspire.hosting/aspirestoreextensions.md)
- Kind: `Methods`
- Members: `1`

Provides extension methods for [IDistributedApplicationBuilder](/reference/api/csharp/aspire.hosting/idistributedapplicationbuilder.md) to create an [IAspireStore](/reference/api/csharp/aspire.hosting/iaspirestore.md) instance.

## GetFileNameWithContent(IAspireStore, string, string)

- Name: `GetFileNameWithContent(IAspireStore, string, string)`
- Modifiers: `extension`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/AspireStoreExtensions.cs#L23-L34)

Gets a deterministic file path that is a copy of the `sourceFilename`. The resulting file name will depend on the content of the file.

```csharp
public static class AspireStoreExtensions
{
    public static string GetFileNameWithContent(
        this IAspireStore aspireStore,
        string filenameTemplate,
        string sourceFilename)
    {
        // ...
    }
}
```

## Parameters

- `aspireStore` ([IAspireStore](/reference/api/csharp/aspire.hosting/iaspirestore.md))
  The [IAspireStore](/reference/api/csharp/aspire.hosting/iaspirestore.md) instance.
- `filenameTemplate` (`string`)
  A file name to base the result on.
- `sourceFilename` (`string`)
  An existing file.

## Returns

`string` -- A deterministic file path with the same content as `sourceFilename`.

## Exceptions

- `FileNotFoundException` -- Thrown when the source file does not exist.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
