{"record":{"id":"f82f2ccbea61ebb7","repo":"SubtitleEdit/subtitleedit","slug":"profile-profilename-not-found-in-settings-ava","errorCode":null,"errorMessage":"Profile '{profileName}' not found in settings. Available: {available}","messagePattern":"Profile '(.+?)' not found in settings\\. Available: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/seconv/Core/SeConvSettings.cs","lineNumber":231,"sourceCode":"            ? Enumerable.Empty<string>()\n            : unknown.Keys.Select(key => prefix + key);\n    }\n\n    /// <summary>\n    /// Writes any non-null values from this object into libse's global Configuration.Settings.\n    /// When <paramref name=\"profileName\"/> is provided, the named profile under <c>profiles.&lt;name&gt;</c>\n    /// is overlaid on top of the base sections. Must be called before any conversion runs.\n    /// </summary>\n    public void ApplyToLibSe(string? profileName = null)\n    {\n        ApplyBaseSections();\n\n        if (!string.IsNullOrWhiteSpace(profileName))\n        {\n            if (Profiles is null || !Profiles.TryGetValue(profileName, out var profile))\n            {\n                var available = Profiles is null ? \"(none defined)\" : string.Join(\", \", Profiles.Keys);\n                throw new InvalidOperationException($\"Profile '{profileName}' not found in settings. Available: {available}\");\n            }\n            profile.ApplyBaseSections();\n        }\n    }\n\n    /// <summary>\n    /// Overlays the <c>exportImages</c> section (base first, then the named profile's, if any)\n    /// onto <paramref name=\"style\"/>. Unlike the other sections this does not go through\n    /// libse's Configuration — image rendering is driven by <see cref=\"ImageExportStyle\"/>\n    /// on <c>ConversionOptions</c>. Call after <see cref=\"ApplyToLibSe\"/>, which validates\n    /// the profile name.\n    /// </summary>\n    public void ApplyExportImages(ImageExportStyle style, string? profileName = null)\n    {\n        ExportImages?.ApplyTo(style);\n\n        if (!string.IsNullOrWhiteSpace(profileName) &&\n            Profiles is not null &&","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/seconv/Core/SeConvSettings.cs#L213-L249","documentation":"Thrown by SeConvSettings.ApplyToLibSe when a profile name is supplied but the Profiles dictionary is null or has no matching key. Profiles are optional named overlays (under `profiles.<name>`) applied on top of the base settings sections; asking for one that was never defined is a configuration mistake. The message lists the available profile names so the caller can correct the value.","triggerScenarios":"Calling `settings.ApplyToLibSe(profileName)` (via `--profile <name>`) where `profileName` is not a key in the settings file's `profiles` object, or where no `profiles` section exists at all.","commonSituations":"Typoing the profile name; profile defined under a different casing (matching is case-sensitive on dictionary keys); copy-paste of a profile name from a different settings file; the profiles section was deleted but the --profile flag was kept.","solutions":["Read the 'Available' list in the error message and use one of those names exactly.","Add the profile under `profiles.<name>` in the settings file (use `seconv dump-settings` for the schema).","Drop the `--profile` flag to use only the base settings.","Check key casing — dictionary lookup is case-sensitive."],"exampleFix":"// settings.json has profiles.dev but not profiles.production\n// before\nseconv in.srt out.srt --settings=s.json --profile=production\n// after\nseconv in.srt out.srt --settings=s.json --profile=dev","handlingStrategy":"validation","validationCode":"if (!string.IsNullOrWhiteSpace(profileName) &&\n    (settings.Profiles is null || !settings.Profiles.ContainsKey(profileName)))\n    throw new ArgumentException(\"Unknown profile: \" + profileName +\n        \". Defined: \" + (settings.Profiles is null ? \"(none)\" : string.Join(\",\", settings.Profiles.Keys)));","typeGuard":"static bool ProfileExists(SeConvSettings s, string? name) =>\n    string.IsNullOrWhiteSpace(name) || (s.Profiles is not null && s.Profiles.ContainsKey(name!));","tryCatchPattern":"try { settings.ApplyToLibSe(profileName); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"not found in settings\"))\n{\n    // read Available list, pick a valid name or proceed without a profile\n}","preventionTips":["List available profiles from settings.Profiles.Keys before applying.","Treat profile names as case-sensitive in documentation.","Add a CI test that every documented profile exists in the shipped settings."],"tags":["settings","profiles","configuration","cli","dict-lookup"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}