{"record":{"id":"e552795e13705c53","repo":"chocolatey/choco","slug":"no-feature-value-by-the-name-0","errorCode":null,"errorMessage":"No feature value by the name '{0}'","messagePattern":"No feature value by the name '(.+?)'","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/services/ChocolateyConfigSettingsService.cs","lineNumber":310,"sourceCode":"                else\r\n                {\r\n                    if (configuration.IncludeHeaders && !hasHeaderRowBeenOutput)\r\n                    {\r\n                        OutputHelpers.LimitedOutput(\"Name\", \"Enabled\", \"Description\");\r\n                        hasHeaderRowBeenOutput = true;\r\n                    }\r\n\r\n                    OutputHelpers.LimitedOutput(feature.Name, !feature.Enabled ? \"Disabled\" : \"Enabled\", feature.Description);\r\n                }\r\n            }\r\n        }\r\n\r\n        public void GetFeature(ChocolateyConfiguration configuration)\r\n        {\r\n            var feature = GetFeatureValue(configuration.FeatureCommand.Name);\r\n            if (feature == null)\r\n            {\r\n                throw new ApplicationException(\"No feature value by the name '{0}'\".FormatWith(configuration.FeatureCommand.Name));\r\n            }\r\n\r\n            this.Log().Info(\"{0}\".FormatWith(feature.Enabled ? \"Enabled\" : \"Disabled\"));\r\n        }\r\n\r\n        public ConfigFileFeatureSetting GetFeatureValue(string featureName)\r\n        {\r\n            var feature = ConfigFileSettings.Features.FirstOrDefault(f => f.Name.IsEqualTo(featureName));\r\n            if (feature == null)\r\n            {\r\n                return null;\r\n            }\r\n\r\n            return feature;\r\n        }\r\n\r\n        public void DisableFeature(ChocolateyConfiguration configuration)\r\n        {\r","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/services/ChocolateyConfigSettingsService.cs#L292-L328","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nchoco feature get --name=allownugetorg\n\n// after (correct name)\nchoco feature get --name=allowNonOfficialSupportedPackages\n// or discover the name:\nchoco feature list","handlingStrategy":"validation","validationCode":"// Validate feature name exists before calling GetFeature\nvar allFeatures = configFileSettings.Features.Select(f => f.Name).ToList();\nif (!allFeatures.Any(f => f.Equals(featureName, StringComparison.OrdinalIgnoreCase)))\n{\n    Console.Error.WriteLine($\"Feature '{featureName}' not found. Available: {string.Join(\", \", allFeatures)}\");\n    return;\n}","typeGuard":"public static bool FeatureExists(ConfigFileSettings settings, string featureName)\n{\n    return settings.Features.Any(f => f.Name.Equals(featureName, StringComparison.OrdinalIgnoreCase));\n}","tryCatchPattern":"try\n{\n    configService.GetFeature(configuration);\n}\ncatch (ApplicationException ex) when (ex.Message.Contains(\"No feature value\"))\n{\n    logger.Error($\"Feature '{configuration.FeatureCommand.Name}' not found. Run 'choco feature list'.\");\n}","preventionTips":["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"],"tags":["config","feature-management","not-found","command-args"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}