コンテンツにスキップ

Configuration settings

このコンテンツはまだ日本語訳がありません。

The Aspire CLI uses a configuration file to control its behavior. You can configure feature flags to enable or disable CLI features, and specify which AppHost project the CLI should use by default for an Aspire solution.

The settings file is stored in a .aspire folder and is named settings.json. Settings files can be stored locally or globally.

The following snippet is an example .aspire/settings.json file:

.aspire/settings.json
{
"appHostPath": "../AspireShop/AspireShop.AppHost/AspireShop.AppHost.csproj",
"features": {
"deployCommandEnabled": "true"
}
}

A global Aspire CLI settings file is stored at $HOME/.aspire/settings.json, and is used as the default settings for the CLI. A local settings file overwrites the settings from the global file. Local settings files are stored at ./.aspire/settings.json.

You can inspect (and test existence of) the local and global settings files:

Check local and global settings files
# Check local and global settings files
for f in ./.aspire/settings.json "$HOME/.aspire/settings.json"; do
[ -f "$f" ] && echo "$f (found)" || echo "$f (not found)"
done
# Optional: open global file
nano "$HOME/.aspire/settings.json"

The CLI automatically generates a local settings file when you run a command that requires interaction with the AppHost, or if you set a config option. For example, aspire run searches for an AppHost project, and when found, generates the ./.aspire/settings.json file with the appHostPath setting set to the project it found.

The Aspire CLI supports two categories of configuration settings:

  • Feature flags
    These settings enable or disable specific CLI features. All feature flag setting names start with feature.

  • CLI behavior
    These settings control how the CLI operates. Currently, the only CLI behavior setting is appHostPath, which specifies the location of the AppHost project.

The following table lists the settings that can be set in the config file:

SettingDescription
appHostPathPath to default AppHost project.
features.execCommandEnabledEnable exec command.
features.minimumSdkCheckEnabledEnforce minimum SDK version.
features.orphanDetectionWithTimestampEnabledUse timestamp-based orphan detection.
features.packageSearchDiskCachingEnabledCache package search results on disk.
features.showDeprecatedPackagesShow deprecated packages.
features.singleFileAppHostEnabledSupport single-file AppHost projects.
features.stagingChannelEnabledUse staging channel packages.
features.updateNotificationsEnabledShow update notifications.

The following is an example with all supported settings:

.aspire/settings.json
{
"appHostPath": "../AspireShop/AspireShop.AppHost/AspireShop.AppHost.csproj",
"features": {
"execCommandEnabled": "true",
"deployCommandEnabled": "true",
"minimumSdkCheckEnabled": "true",
"orphanDetectionWithTimestampEnabled": "true",
"packageSearchDiskCachingEnabled": "true",
"showDeprecatedPackages": "true",
"singleFileAppHostEnabled": "true",
"stagingChannelEnabled": "true",
"updateNotificationsEnabled": "true"
}
CommandStatusFunction
aspire configStableCommand driver for managing Aspire configuration.
aspire config listStableList all configuration values.
aspire config get <key>StableGet a configuration value.
aspire config set <key> <value>StableSet a configuration value.
aspire config delete <key>StableDelete a configuration value.
質問 & 回答 コラボレーション コミュニティ ディスカッション 視聴