unoplatform/uno · error · Exception
Missing closing quote
Error message
Missing closing quote
What it means
When parsing a string literal argument in an x:Bind invocation, the parser expects a matching closing '"' before end-of-input. If the opening quote is never closed, it throws. Example trigger: {x:Bind Foo("unclosed)}.
Source
Thrown at src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/Utils/XBindExpressionParser.CoreParser.cs:104
return new XBindInvocation() { Path = bindPath, Arguments = arguments.ToArray() };
}
private XBindArgument ParseXBindArgument()
{
SkipWhitespaces();
if (Current == '"')
{
// literal string argument
var oldPosition = _position++;
while (!IsDone && Current != '"')
{
_position++;
}
if (Current != '"')
{
throw new Exception("Missing closing quote");
}
var literal = _xBind.Substring(oldPosition, ++_position - oldPosition);
return new XBindLiteralArgument() { LiteralArgument = literal };
}
else if (char.IsDigit(Current))
{
// literal numeric argument
var oldPosition = _position;
while (char.IsDigit(Current))
{
_position++;
}
if (Current == '.')
{
_position++;
if (!char.IsDigit(Current))View on GitHub (pinned to 0418340488)
Solutions
- Add the closing '"' for the string literal.
- Escape any literal quotes inside the string if needed.
Example fix
<!-- before -->
<TextBlock Text="{x:Bind Greet("world}" />
<!-- after -->
<TextBlock Text="{x:Bind Greet("world")}" /> Defensive patterns
Strategy: validation
Validate before calling
static bool HasClosingQuote(string expr)
{ bool open = false; foreach (var c in expr) { if (c == '"') open = !open; } return !open; } Prevention
- Always close string literals in x:Bind with a matching '"'.
- Use an editor that highlights unterminated string literals.
When it happens
Trigger: An x:Bind string literal argument whose opening '"' has no closing '"', e.g. {x:Bind Foo("bar)}.
Common situations: Unterminated string literal in a hand-edited x:Bind; a copy/paste that dropped the closing quote.
Related errors
- Expected end of x:Bind expression or start of argument list.
- Expected end of expression after invocation.
- Expected ')' after parsing invocation arguments
- Expected digits after floating point.
- Missing parenthesis?
AI-assisted analysis of unoplatform/uno@0418340488 (2026-08-13).
Data as JSON: /api/errors/f195edbdbf57e81a.
Report an issue: GitHub.