{"record":{"id":"153a8d401b97105f","repo":"tui-cs/Terminal.Gui","slug":"error-applying-configuration-change-tie-message","errorCode":null,"errorMessage":"Error Applying Configuration Change: {tie.Message}","messagePattern":"Error Applying Configuration Change: (.+?)","errorType":"exception","errorClass":"JsonException","httpStatus":null,"severity":"error","filePath":"Terminal.Gui/Configuration/ConfigProperty.cs","lineNumber":99,"sourceCode":"                // Use DeepCloner to create a deep copy of PropertyValue\n                object? val = DeepCloner.DeepClone (PropertyValue);\n\n                Debug.Assert (!Immutable);\n                PropertyInfo.SetValue (null, val);\n\n            }\n        }\n        catch (TargetInvocationException tie)\n        {\n            if (tie.InnerException is { })\n            {\n                throw new JsonException (\n                                         $\"Error Applying Configuration Change: {tie.InnerException.Message}\",\n                                         tie.InnerException\n                                        );\n            }\n\n            throw new JsonException ($\"Error Applying Configuration Change: {tie.Message}\", tie);\n        }\n        catch (ArgumentException ae)\n        {\n            throw new JsonException (\n                                     $\"Error Applying Configuration Change ({PropertyInfo?.Name}): {ae.Message}\",\n                                     ae\n                                    );\n        }\n\n        return PropertyValue != null;\n    }\n\n    /// <summary>\n    /// INTERNAL: Creates a copy of a ConfigProperty with the same metadata but no value.\n    /// </summary>\n    /// <param name=\"source\">The source ConfigProperty.</param>\n    /// <returns>A new ConfigProperty instance.</returns>\n    internal static ConfigProperty CreateCopy (ConfigProperty source)","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/tui-cs/Terminal.Gui/blob/2e47b11478db083499917f2ad27c34d30efb0df1/Terminal.Gui/Configuration/ConfigProperty.cs#L81-L117","documentation":"Thrown by ConfigProperty.Apply's TargetInvocationException catch when tie.InnerException is null — an unusual case where reflection wrapped an exception without an inner. The outer TargetInvocationException message is used directly. Functionally equivalent to error 30 but for the rare null-inner case.","triggerScenarios":"A TargetInvocationException constructed without an inner exception (atypical); almost never seen in normal .NET reflection paths.","commonSituations":"A third-party property setter throwing a hand-built TargetInvocationException; an edge case in a dynamically emitted setter.","solutions":["Inspect the full ToString() of the thrown JsonException's InnerException (the TargetInvocationException itself) for the stack trace.","Reproduce by calling the static setter directly with the same value to bypass reflection and get a clearer error.","Report if it reproduces — the null-inner path is unexpected."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { ConfigurationManager.Apply (); }\ncatch (JsonException ex) when (ex.InnerException is TargetInvocationException)\n{ /* inspect ex.InnerException.ToString() for the real stack */ }","preventionTips":["If this rare null-inner path reproduces, report it — it usually indicates a malformed TargetInvocationException.","Set the property directly to reproduce the underlying failure more clearly."],"tags":["configuration","apply","reflection","targetinvocationexception"],"backgroundTag":null,"analyzedSha":"2e47b11478db083499917f2ad27c34d30efb0df1","analyzedAt":"2026-08-13T19:20:08.826Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}