Skip to content

[Dashboard] Reject numeric persistence mode values #19781

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

PostConfigureDashboardOptions uses Enum.TryParse followed by Enum.IsDefined, so numeric strings that map to defined enum members are accepted.

For example, --persistence 1 initializes the Dashboard in Run mode even though user-facing validation lists only None, Run, and Resume.

Expected Behavior

Only the documented named values should be accepted.

Steps To Reproduce

  1. Run aspire dashboard run --persistence 1.
  2. Inspect the Dashboard startup log.
  3. The Dashboard initializes in Run mode instead of rejecting the value.

Exceptions (if any)

N/A

Aspire doctor output

Aspire CLI 13.6.0-pr.18924.g5ee63941
Windows 10.0.26200

Anything else?

Related to #18924. Source: src/Aspire.Dashboard/Configuration/PostConfigureDashboardOptions.cs:39-50. The same behavior remains on current main.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions