{"record":{"id":"b5fde79d8df5658e","repo":"cefsharp/CefSharp","slug":"property-0-not-found-on-object-of-type-1","errorCode":null,"errorMessage":"Property {0} not found on Object of Type {1}","messagePattern":"Property (.+?) not found on Object of Type (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"CefSharp/Internals/JavascriptObjectRepository.cs","lineNumber":589,"sourceCode":"        bool IJavascriptObjectRepositoryInternal.TryGetProperty(long objectId, string name, out object result, out string exception)\n        {\n            return TryGetProperty(objectId, name, out result, out exception);\n        }\n\n        protected virtual bool TryGetProperty(long objectId, string name, out object result, out string exception)\n        {\n            exception = \"\";\n            result = null;\n            JavascriptObject obj;\n            if (!objects.TryGetValue(objectId, out obj))\n            {\n                return false;\n            }\n\n            var property = obj.Properties.FirstOrDefault(p => p.JavascriptName == name);\n            if (property == null)\n            {\n                throw new InvalidOperationException(string.Format(\"Property {0} not found on Object of Type {1}\", name, obj.Value.GetType()));\n            }\n\n            try\n            {\n                if (obj.PropertyInterceptor == null)\n                {\n                    result = property.GetValue(obj.Value);\n                }\n                else\n                {\n                    result = obj.PropertyInterceptor.InterceptGet(() => property.GetValue(obj.Value), property.ManagedName);\n                }\n                return true;\n            }\n            catch (Exception ex)\n            {\n                exception = ex.ToString();\n            }","sourceCodeStart":571,"sourceCodeEnd":607,"githubUrl":"https://github.com/cefsharp/CefSharp/blob/16bc6e0711a4945be17e8bc4bc7ccf9469f3fdec/CefSharp/Internals/JavascriptObjectRepository.cs#L571-L607","documentation":"Thrown by TryGetProperty (the getter path) when the bound object was found via objectId but no property has a JavascriptName matching the requested name. As with the methods, the object-not-found case returns false without throwing, while a property-name mismatch raises InvalidOperationException. The message prints the requested property name and the object's runtime type.","triggerScenarios":"JavaScript reads a property by a name that does not exist on the bound object (typo, casing, or property filtered out by BindingOptions); reading a property on the wrong object id.","commonSituations":"Renaming a C# property and not updating JS; relying on the managed name instead of the camelCase JS name; property excluded from binding; stale generated contract.","solutions":["Read the property by its JavaScript (camelCase) name.","Confirm the property is in obj.Properties and not excluded by BindingOptions.","Regenerate JS/TS bindings after C# property renames.","Audit binding options that restrict which properties are exposed."],"exampleFix":"// C#: public string UserName { get; set; } -> JS name \"userName\"\n// before (JS): const n = obj.username; // typo/wrong casing\n// after  (JS): const n = obj.userName;","handlingStrategy":"validation","validationCode":"var exposedProps = obj.Properties.Select(p => p.JavascriptName);\nif (!exposedProps.Contains(jsPropName, StringComparer.Ordinal))\n    throw new InvalidOperationException($\"Property {jsPropName} not exposed.\");","typeGuard":null,"tryCatchPattern":"try { repository.TryGetProperty(objectId, name, out value, out ex); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"Property\") && ex.Message.Contains(\"not found\"))\n{ /* property name mismatch from JS */ }","preventionTips":["Read properties by their camelCase JavaScript name.","Regenerate contracts after property renames.","Verify BindingOptions did not filter the property."],"tags":["cefsharp","javascript-binding","property-not-found","interop-naming"],"backgroundTag":null,"analyzedSha":"16bc6e0711a4945be17e8bc4bc7ccf9469f3fdec","analyzedAt":"2026-08-13T19:57:05.828Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}