unoplatform/uno · error · Exception

Expected ')' in attached property syntax.

Error message

Expected ')' in attached property syntax.

What it means

Thrown by the x:Bind path parser during attached-property syntax parsing. After '.(' is consumed and the inner path is confirmed to be a member access node 'Owner.Property', the parser checks for the closing ')'. If the next character is not ')', this exception fires.

Source

Thrown at src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/Utils/XBindExpressionParser.CoreParser.cs:194

			while (true)
			{
				if (Current == '.')
				{
					_position++;
					if (Current == '(')
					{
						_position++;

						var attachedPropertyPath = ParseXBindPath();

						if (attachedPropertyPath is not XBindMemberAccess memberAccess)
						{
							throw new Exception("Expected attached property path to be member access.");
						}

						if (Current != ')')
						{
							throw new Exception("Expected ')' in attached property syntax.");
						}

						path = new XBindAttachedPropertyAccess() { Member = path, PropertyClass = memberAccess.Path, PropertyName = memberAccess.Identifier };

						_position++;
					}
					else
					{
						path = new XBindMemberAccess() { Path = path, Identifier = ParseXBindIdentifier() };
					}
				}
				else if (Current == '[')
				{
					var currentPosition = ++_position;
					while (Current != ']')
					{
						_position++;
					}

View on GitHub (pinned to 0418340488)

Solutions

  1. Add the missing ')' immediately after 'ClassName.PropertyName' in the '.(...)' group.
  2. Remove any stray characters between the property name and the closing ')'.
  3. Validate the full x:Bind string reads as Element.(Class.Property).

Example fix

<!-- before -->
<Text Canvas.Left="{x:Bind MyElement.(Canvas.Left}" />
<!-- after -->
<Text Canvas.Left="{x:Bind MyElement.(Canvas.Left)}" />
Defensive patterns

Strategy: validation

Validate before calling

// Ensure the closing ')' is present in attached-property x:Bind syntax.
// Linting check: every '.(' in an x:Bind path must be followed eventually by ')'
// after exactly 'Class.Property'.

Prevention

When it happens

Trigger: An x:Bind attached-property path is missing its closing ')' — e.g. {x:Bind Element.(Canvas.Left} or {x:Bind Element.(Canvas.Left. Extra}.

Common situations: Typo or truncation in the closing parenthesis of an attached property path; an XAML merge or formatter introduced an extra character between the property name and ')'.

Related errors


AI-assisted analysis of unoplatform/uno@0418340488 (2026-08-13). Data as JSON: /api/errors/caa5ed231adca15e. Report an issue: GitHub.