Expected '{0}'

This error occurs during parsing, when a reserved character is expected but a different character is encountered. This error is often followed by Closing tag for element '<{0}>' was not found and Character sequence '{0}' was not expected at this location.

This error is raised when the XAML file contains lexical elements that are not valid in XML.

Error ID: XAML0301

Note

This error message also applies to the Silverlight Designer.

To correct this error

  • Correct the syntax error by checking for spelling and balanced opening and closing tags.

Example

The following code example shows a declaration with a syntax error. Uncomment the declaration to raise error XAML0301.

<!-- Uncomment the following line to raise error XAML0301. -->
<!-- <Button  Caption='OK' /a > -->

See Also

Concepts

XAML Errors and Help

Other Resources

XAML in WPF

XAML in Silverlight