Welcome to EMC Consulting Blogs Sign in | Join | Help

mister mann

every day is just a game of give and take... [ follow me on twitter: @mark_mann ]

Error of the day: Xaml compilation error 60.

Just a quick one for reference (although it took me a bit to figure out)…

I was upgrading my application from Silverlight 2 to Silverlight 3 I must have tidied up my Xaml and introduced a compilation error. Both Visual Studio 2008 and Blend3 did not pick it up at design time – much to my frustration!

Problem:

Compiling my Silverlight application prompted the following error.

Error 60:
Unexpected NONE in parse rule ElementBody ::= ATTRIBUTE* ( PropertyElement | Content )* . ENDTAG..
 

Double clicking the error in took me to my Xaml, but positioned itself within the  Grid x:Name="LayoutRoot" element as seen below.

image

Digging about by removing attributes or redefining the element did not produce any resolution, especially since the error states that there are no attributes when clearly there are!

Solution:

The broken compilation rule actually does make sense, if you consider the line before where Visual Studio thinks there is a problem. Taking a look at the closed

UserControl.Resources element it became apparent that the compiler expects this to be an open element (even if it remains empty) if it has been declared.

image

So, either declare the UserControl.Resources element as an open, empty tag, or fill it with some resources, or just remove it!

Published 15 July 2009 18:02 by Mark.Mann

Comments

No Comments
Anonymous comments are disabled
Powered by Community Server (Personal Edition), by Telligent Systems