Click here to Skip to main content
12,635,132 members (26,137 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

14.7K views
1 bookmarked
Posted

Solving Silverlight error : Unexpected NONE in parse rule ElementBody

, 15 Oct 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
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>

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

User-Rock
Software Developer
Australia Australia
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
QuestionBEST TIP EVER dude.... Pin
jayvardhan12324-Aug-12 22:28
memberjayvardhan12324-Aug-12 22:28 
GeneralThough he doesn't say it, the Grids seem to be succeptible t... Pin
OmegaMan2-Feb-12 11:34
memberOmegaMan2-Feb-12 11:34 
GeneralReason for my vote of 5 Nice tip, might save some hair pulli... Pin
Julien Villers17-Oct-11 23:33
memberJulien Villers17-Oct-11 23:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161208.2 | Last Updated 15 Oct 2011
Article Copyright 2011 by User-Rock
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid