Skip to content

Deployment state cache fails to load on Linux due to case sensitivity #13102

@vhvb1989

Description

@vhvb1989

Description

When running aspire deploy on Linux (or macOS), the deployment state cache is not loaded properly due to a case mismatch in environment name handling between saving and loading.

Steps to Reproduce

  1. Run aspire deploy on Linux with default environment (Production)
  2. Deploy completes and saves state to ~/.aspire/deployments/{sha}/production.json (lowercase)
  3. Run aspire deploy again
  4. Cache is not loaded - Aspire looks for Production.json (capitalized) instead of production.json

Expected Behavior

The deployment state cache should be loaded automatically, reusing previous values for subscription, location, resource group, etc.

Actual Behavior

The cache is only loaded if you explicitly specify: aspire deploy --environment production (lowercase)

Without the flag, Aspire tries to find Production.json but the file is actually production.json, causing a silent failure on case-sensitive filesystems.

Root Cause

  • Saving: FileDeploymentStateManager.GetStatePath() uses .ToLowerInvariant() on the environment name
  • Loading: DistributedApplicationBuilder.LoadDeploymentState() uses the raw EnvironmentName without normalization

This inconsistency causes the issue on case-sensitive filesystems (Linux/macOS).

Impact

  • Users on Linux/macOS cannot benefit from deployment state caching without knowing to use lowercase environment names
  • This affects the deployment experience and requires re-entering deployment configuration on every run

Environment

  • OS: Linux (case-sensitive filesystem)
  • .NET Aspire version: Latest (main branch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions