chocolatey/choco · error · ApplicationException
No feature value by the name '{0}'
Error message
No feature value by the name '{0}' What it means
Thrown by ChocolateyConfigSettingsService.GetFeature when the feature name specified in configuration.FeatureCommand.Name does not match any entry in ConfigFileSettings.Features. The lookup is case-insensitive (using IsEqualTo). This occurs during 'choco feature get --name=<x>' when <x> is not a known feature in the chocolatey.config file.
Source
Thrown at src/chocolatey/infrastructure.app/services/ChocolateyConfigSettingsService.cs:310
else
{
if (configuration.IncludeHeaders && !hasHeaderRowBeenOutput)
{
OutputHelpers.LimitedOutput("Name", "Enabled", "Description");
hasHeaderRowBeenOutput = true;
}
OutputHelpers.LimitedOutput(feature.Name, !feature.Enabled ? "Disabled" : "Enabled", feature.Description);
}
}
}
public void GetFeature(ChocolateyConfiguration configuration)
{
var feature = GetFeatureValue(configuration.FeatureCommand.Name);
if (feature == null)
{
throw new ApplicationException("No feature value by the name '{0}'".FormatWith(configuration.FeatureCommand.Name));
}
this.Log().Info("{0}".FormatWith(feature.Enabled ? "Enabled" : "Disabled"));
}
public ConfigFileFeatureSetting GetFeatureValue(string featureName)
{
var feature = ConfigFileSettings.Features.FirstOrDefault(f => f.Name.IsEqualTo(featureName));
if (feature == null)
{
return null;
}
return feature;
}
public void DisableFeature(ChocolateyConfiguration configuration)
{
View on GitHub (pinned to 0d5abdd10c)
Solutions
- List all available features with 'choco feature list' to find the correct name
- Check spelling and use the exact feature name from the list output
- If the feature was renamed, consult current documentation for the new name
- Restore the default config file if it was corrupted: 'choco feature list' will show all known features
Example fix
// before choco feature get --name=allownugetorg // after (correct name) choco feature get --name=allowNonOfficialSupportedPackages // or discover the name: choco feature list
Defensive patterns
Strategy: validation
Validate before calling
// Validate feature name exists before calling GetFeature
var allFeatures = configFileSettings.Features.Select(f => f.Name).ToList();
if (!allFeatures.Any(f => f.Equals(featureName, StringComparison.OrdinalIgnoreCase)))
{
Console.Error.WriteLine($"Feature '{featureName}' not found. Available: {string.Join(", ", allFeatures)}");
return;
} Type guard
public static bool FeatureExists(ConfigFileSettings settings, string featureName)
{
return settings.Features.Any(f => f.Name.Equals(featureName, StringComparison.OrdinalIgnoreCase));
} Try / catch
try
{
configService.GetFeature(configuration);
}
catch (ApplicationException ex) when (ex.Message.Contains("No feature value"))
{
logger.Error($"Feature '{configuration.FeatureCommand.Name}' not found. Run 'choco feature list'.");
} Prevention
- Run 'choco feature list' to discover exact feature names before using 'choco feature get'
- Copy feature names exactly from the list output
- Be aware that feature names are case-insensitive but must match otherwise
- Keep documentation handy or bookmark the feature list for reference
When it happens
Trigger: Running 'choco feature get --name=nonexistent'. The feature name has a typo. The feature was removed or renamed in a newer Chocolatey version. The config file was manually edited and features were deleted. Case differences are handled by IsEqualTo so only actual name mismatches trigger this.
Common situations: User misspells the feature name. User follows outdated documentation referencing a renamed feature. Config file is corrupted or reset. Feature name includes extra whitespace or special characters.
Related errors
- Feature '{0}' not found
- No configuration value by the name '{0}'
- Feature '{0}' is not supported.
- A single config command must be listed. Please see the help
- When specifying the subcommand '{0}', you must also specify
AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13).
Data as JSON: /api/errors/e552795e13705c53.
Report an issue: GitHub.