{"record":{"id":"8f90db8b47c645bc","repo":"tui-cs/Terminal.Gui","slug":"propertyname-unsupported-configuration-converte","errorCode":null,"errorMessage":"{propertyName}: Unsupported configuration converter type \"{converterType.FullName}\" when dynamic code is unavailable.","messagePattern":"(.+?): Unsupported configuration converter type \"(.+?)\" when dynamic code is unavailable\\.","errorType":"exception","errorClass":"JsonException","httpStatus":null,"severity":"error","filePath":"Terminal.Gui/Configuration/ScopeJsonConverter.cs","lineNumber":94,"sourceCode":"\n                        continue;\n                    }\n\n                    if (TryReadWithKnownConverter (ref reader, propertyType!, converterType, options, out object? convertedValue))\n                    {\n                        scope! [propertyName].PropertyValue = convertedValue;\n\n                        continue;\n                    }\n\n                    if (TryReadWithDynamicConverter (ref reader, propertyType!, converterType, options, out convertedValue))\n                    {\n                        scope! [propertyName].PropertyValue = convertedValue;\n\n                        continue;\n                    }\n\n                    throw new JsonException ($\"{propertyName}: Unsupported configuration converter type \\\"{converterType.FullName}\\\" when dynamic code is unavailable.\");\n                }\n                scope! [propertyName].PropertyValue = DeserializePropertyValue (ref reader, propertyType!, options);\n\n                // Logging.Warning ($\"{propertyName} = {scope! [propertyName].PropertyValue}\");\n            }\n            else\n            {\n                // It is not a config property. Maybe it's just a property on the Scope with [JsonInclude]\n                // like ScopeSettings.$schema.\n                // If so, don't add it to the dictionary but apply it to the underlying property on\n                // the scopeT.\n                // BUGBUG: This is terrible design. The only time it's used is for $schema though.\n                PropertyInfo? property = typeof (TScopeT).GetProperties ()\n                                                         .Where (p =>\n                                                                 {\n                                                                     if (p.GetCustomAttribute (typeof (JsonIncludeAttribute)) is JsonIncludeAttribute { } jia)\n                                                                     {\n                                                                         var jsonPropertyNameAttribute =","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/tui-cs/Terminal.Gui/blob/2e47b11478db083499917f2ad27c34d30efb0df1/Terminal.Gui/Configuration/ScopeJsonConverter.cs#L76-L112","documentation":"A config property carries a custom JsonConverter type. The converter first tries the hardcoded known converters (TryReadWithKnownConverter), then dynamic instantiation (TryReadWithDynamicConverter). If dynamic code is unavailable (RuntimeFeature.IsDynamicCodeSupported is false — NativeAOT/trimmed) and the converter type is not in the known set, reading fails.","triggerScenarios":"Running under NativeAOT or trimming with a custom property-level JsonConverter that is not registered in the known set; deploying an AOT-compiled Terminal.Gui app that relies on a custom config converter.","commonSituations":"Publishing with ReadyToRun/NativeAOT; trimming an app that uses a third-party config converter; AOT deployment of a Terminal.Gui app.","solutions":["Avoid custom property-level JsonConverters in AOT scenarios, or register the converter type in TryReadWithKnownConverter (requires a library change).","Run on a standard JIT runtime (RuntimeFeature.IsDynamicCodeSupported == true) if custom converters are required.","Move custom deserialization out of the config pipeline and apply it after ConfigurationManager loads."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported\n    && usesCustomConverter)\n{\n    // custom property-level converters will fail under AOT; avoid them\n}","typeGuard":null,"tryCatchPattern":"try { ConfigurationManager.Apply (); }\ncatch (JsonException ex) when (ex.Message.Contains (\"when dynamic code is unavailable\"))\n{ /* converter type is unsupported under AOT; see ex.Message for the type */ }","preventionTips":["Avoid custom property-level JsonConverters in AOT/trimmed scenarios.","Test config loading under the same runtime (JIT vs AOT) you ship."],"tags":["config","json","aot","trimming","runtime"],"backgroundTag":null,"analyzedSha":"2e47b11478db083499917f2ad27c34d30efb0df1","analyzedAt":"2026-08-13T19:20:08.826Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}