---
title: Local Development
description: Set up Forge templates and containers and run your application with Aspire.
moved_from:
  - reference/tools/aspire.md
  - reference/tools/docker-desktop.md
---

# Local Development

Run your application and its dependencies through the Aspire AppHost. The dashboard shows resource status and local telemetry; deployed infrastructure follows the [deployment workflow](../deploy/index.md), not the local orchestration process.

## Prerequisites

Use the SDK versions in [Version Compatibility](../../reference/version-compatibility.md), install the [SAIF CLI](../../learn/install-saif-cli.md), and install the [Aspire CLI](https://aspire.dev/get-started/install-cli/).

### Docker Desktop provisioning

Docker Desktop requires IT approval on SAIF developer machines:

1. Request membership in the Active Directory `DesktopDocker_Users` group through ServiceNow.
2. Install Docker Desktop from Software Center.
3. Add your user to the developer machine's local `docker-users` group.

Start Docker Desktop before running container-based AppHost resources, including local mock services. Use [Docker's documentation](https://docs.docker.com/desktop/) for the product's general setup and troubleshooting.

## Setup

### Install Production Templates

Follow [Create projects with Forge templates](../../learn/project-templates.md) for installation, template discovery, generation, and the publishing distinction between `saif new` and `dotnet new`. [SAIF CLI installation](../../learn/install-saif-cli.md) owns NuGet feed access and `saif doctor fix` setup.

After generation, open the solution and launch its AppHost from your IDE to view the running resources in the Aspire dashboard.

### Test Execution: Native Microsoft Testing Platform (MTP)

Generated repositories use native MTP, not the VSTest bridge. Follow [Testing](../testing/index.md#test-execution-native-microsoft-testing-platform-mtp) for the runner configuration, test command, coverage command, and requirements when adding a feature template to an older application.

## Forge service defaults

Forge's `AddServiceDefaults()` and `UseServiceDefaults()` build on Aspire's service-defaults pattern. See the [`SAIF.Platform` reference](../../reference/dotnet/SAIF.Platform/index.md) for the API surface and [Aspire documentation](https://aspire.dev/docs/) for orchestration.

- **CORS differs between local and deployed execution.** In Development, `AddDefaultCors()` recursively discovers origins from the `Services` configuration section and allows methods, headers, and credentials for those origins. Outside Development it adds no default policy, and `UseServiceDefaults()` does not enable CORS. Configure your service's deployed policy explicitly rather than assuming local behavior carries over. These branches live in [`Extensions.cs`](https://github.com/saif-corp/forge/blob/main/src/dotnet/SAIF.Platform/Extensions.cs).
- **Telemetry settings have one home.** See [Observability](../observability/index.md#forge-collection-defaults) for wildcard instrumentation, sampling, export, and the `platform.*` diagnostic tags.
- **The default cache is per-instance.** Without `REDIS_CONNECTION_STRING`, `ConfigureDistributedCache()` registers an in-memory cache, not shared infrastructure. Under scale-out, an instance without a cached OBO token needs its own token exchange; inspect `saif.authentication.token_cache.hits` and `saif.authentication.token_cache.misses` rather than assuming another instance's cache applies. See [How Authentication Works](../../reference/architecture/how-authentication-works.md) for token flows. A shared cache requires provisioning and an explicit configuration decision; the fallback alone does not supply it.

## Service discovery: local to deployed

Keep logical resource names consistent between AppHost references and your client registration. [Downstream API Calls](../apis/calling-apis.md#service-discovery-local-to-deployed) owns the local-to-deployed name mapping, Front Door/APIM routing, private network, and PR-slot distinctions. [Golden Path: Service Discovery](../../reference/architecture/golden-path.md#service-discovery) shows the local `WithReference()` pattern.

## Mock dependencies

Use [API Mocking](mocking/index.md) to choose local WireMock hosting, cloud-managed definitions, or recording. Use real endpoints separately when you need to verify an external provider's actual behavior.

## Related Documentation

- [API Testing with Aspire](../testing/api-integration-testing.md)
- [Web Testing with Playwright](../testing/web-integration-testing.md)
- [Troubleshooting](../../troubleshoot/index.md)
- [CLI command reference](../../reference/dotnet/SAIF.Platform.CLI/commands.md)
