65.9K
CodeProject is changing. Read more.
Home

Solving Silverlight error : Unexpected NONE in parse rule ElementBody

starIconstarIconstarIconstarIconstarIcon

5.00/5 (2 votes)

Oct 14, 2011

CPOL
viewsIcon

20644

Silverlight XAML parsing error

Are you facing the following error while compiling Silverlight code? "Unexpected NONE in parse rule ElementBody ::= ATTRIBUTE* ( PropertyElement | Content )* . ENDTAG.." Please check your XAML, it must be containing syntax like:
<UserControl.Resources />
OR:
<Grid.ColumnDefinitions />
OR:
<ListBox>
     <ListBox.Items/>
</ListBox>
For unknown reasons, Silverlight compiler fails if you have declared something similar to these. Reason I could guess is Silverlight compiler fails to compile empty collection syntax declared in the aforementioned way. It though supports empty collections if declared as below:
<UserControl.Resources > </UserControl.Resources >
OR:
<Grid.ColumnDefinitions > </Grid.ColumnDefinitions >
OR:
<ListBox>
    <ListBox.Items></ListBox.Items>
</ListBox>
Solving Silverlight error : Unexpected NONE in parse rule ElementBody - CodeProject