{"record":{"id":"770a57555746d720","repo":"unoplatform/uno","slug":"name-property-is-not-set","errorCode":null,"errorMessage":"Name property is not set","messagePattern":"Name property is not set","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/System.Xaml/System.Windows.Markup/Bind.cs","lineNumber":35,"sourceCode":"\n\t\tpublic Bind(string path)\n\t\t{\n\t\t\tPath = path;\n\t\t}\n\n\t\t[ConstructorArgument (\"path\")]\n\t\tpublic string Path { get; set; }\n\n\t\tpublic override object ProvideValue (IServiceProvider serviceProvider)\n\t\t{\n\t\t\tif (serviceProvider == null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException (\"serviceProvider\");\n\t\t\t}\n\n\t\t\tif (Path == null)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException (\"Name property is not set\");\n\t\t\t}\n\n\t\t\tvar r = serviceProvider.GetService (typeof (IXamlNameResolver)) as IXamlNameResolver;\n\t\t\tif (r == null)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException (\"serviceProvider does not implement IXamlNameResolver\");\n\t\t\t}\n\n\t\t\tvar ret = r.Resolve (Path);\n\t\t\tif (ret == null)\n\t\t\t{\n\t\t\t\tret = r.GetFixupToken (new string [] { Path }, true);\n\t\t\t}\n\n\t\t\treturn ret;\n\t\t}\n\t}\n}","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/System.Xaml/System.Windows.Markup/Bind.cs#L17-L53","documentation":"InvalidOperationException thrown by Bind.ProvideValue (System.Xaml, ported from Mono) when the Path property is null. Path is the named reference Bind resolves via IXamlNameResolver; without it there is nothing to bind. Note the message says 'Name property is not set' even though the property is called Path — a long-standing wording quirk in this port.","triggerScenarios":"Constructing Bind without a path (parameterless) and calling ProvideValue, or a XAML usage that omits the path argument.","commonSituations":"Default-constructing Bind in code and forgetting to set Path, or malformed markup that does not supply the constructor argument.","solutions":["Always supply Path via the Bind(string path) constructor or set the Path property before ProvideValue.","In XAML, ensure the Bind markup extension includes its path argument.","Add a guard: if (bind.Path is null) bind.Path = expectedPath; before evaluation."],"exampleFix":"// before\nvar b = new Bind();\nb.ProvideValue(sp); // Path is null\n\n// after\nvar b = new Bind(\"MyTargetName\");\nb.ProvideValue(sp);","handlingStrategy":"validation","validationCode":"static Bind RequirePath(Bind b) => b.Path is null ? throw new InvalidOperationException(\"Bind.Path is required.\") : b;","typeGuard":"static bool IsReady(Bind b) => !string.IsNullOrEmpty(b.Path);","tryCatchPattern":"try { return b.ProvideValue(sp); } catch (InvalidOperationException ex) when (ex.Message.Contains(\"Name property is not set\")) { b.Path = fallbackPath; return b.ProvideValue(sp); }","preventionTips":["Always construct Bind with the path argument.","Set Path explicitly when default-constructing.","Validate Path before invoking ProvideValue."],"tags":["xaml","markup-extension","bind","invalidoperation","system-xaml"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}