Page view counter

Silverlight Tips of the Day - Blog by Mike Snow

Game Programming with Silverlight

Silverlight Tip of the Day #96 – The meaning of AG_E_PARSER_BAD_PROPERTY_VALUE

If you ever run into this error when running your application you might be a bit perplexed by its encrypted meaning.

Looking at the exceptions details you will see something like which really doesn’t help you very much:

System.Windows.Markup.XamlParseException occurred
  Message="AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 4 Position: 53]"
  LineNumber=4
  LinePosition=53
  StackTrace:
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at MapEditor.TerrainTile.InitializeComponent()
       at MapEditor.TerrainTile..ctor(Double xLoc, Double yLoc, Double tileRadius)
  InnerException:

The Silverlight Team is working to make improvements in error reporting. For now, to better understand what is causing these errors you should take a careful look at your XAML to see if something declared is missing or wrong. For example, say you have an event handler in your XAML that is not anywhere to be found in your code behind. Often I find myself removing an event handler I no longer want in my code behind but forgetting to remove it in my XAML as well.

Now you know (if you didn’t already).

--Mike

Comments

Microsoft Weblogs said:

If you ever run into this error when running your application you might be a bit perplexed by its encrypted

# February 20, 2009 10:15 PM

obsid said:

Dont think for a second this is the only place that error occurs.  I have had this error hundreds if not thousands of times, for a variety of reasons.  Your lucky that you got a stack trace at all.  Alot of the time it just comes back that a call to XcpImports failed with an error code of 0x00000 or something similar.  I see alot of problems with attached depeancy properties if everything isnt exactly right.  There are tons of places that cause this error, and it isnt clear at ALL which one of the dozen possible causes is the reason.  All the error messages that start with AG_E_... are really crappy in telling you how or why something failed.

# February 20, 2009 11:31 PM

wireplay said:

Can we just say, politely, that error reporting in Silverlight is lacking? Silverlight team should put a LOT of effort into this area because it is really bad right now. I don't understand the complexities, I am sure, but it is a place to make some improvements, IMO.

# February 20, 2009 11:40 PM

Community Blogs said:

In this issue: ScrumWall, Mike Snow, Joel Neubeck, WorkSight Blog, Robby Ingebretsen, and Bill Reiss

# February 21, 2009 8:46 PM

The meaning of AG_E_PARSER_BAD_PROPERTY_VALUE said:

Pingback from  The meaning of AG_E_PARSER_BAD_PROPERTY_VALUE

# February 23, 2009 9:14 AM

tgrand said:

Agree with the previous posters.  These errors often shed little or no light on the problem.  Not much fun to debug, especially in those nasty cases when the problem only happens on 2 machines out of 10.

Better error reporting would be a huge improvement to Silverlight.

# February 23, 2009 10:27 AM

mike.snow said:

Thanks for your feedback. I have talked with people on the Silverlight team and they are working to make great improvements in this area.

# February 23, 2009 11:45 AM

tgrand said:

Thanks Mike, that's great news!

# February 25, 2009 11:30 AM

Programming with Silverlight, WPF & .NET » AG_E_PARSER_BAD_PROPERTY_VALUE said:

Pingback from  Programming with Silverlight, WPF & .NET » AG_E_PARSER_BAD_PROPERTY_VALUE

# February 28, 2009 5:48 AM

sandeepsaxena said:

How should I fix this in my xaml.vb file ?

# March 12, 2009 3:46 AM

Visual Web Developer Team Blog said:

Most Recent Posts: Silverlight Tip of the Day #106 - Setting Default Browser from within VS Silverlight

# April 6, 2009 6:13 PM

Silverlight Tips of the Day - Blog by Mike Snow said:

The purpose of this post is to create an outline summary all the blogs from my Silverlight Tips of the

# April 6, 2009 6:20 PM

NewsPeeps said:

Thank you for submitting this cool story - Trackback from NewsPeeps

# August 8, 2009 6:36 PM

Dark Jester said:

Ran into this today. One thing of note is that when I opened the .Xaml page in Expression Blend, it gave me the exact location of the error. Better debug features in Blend than in SL itself? :)

# October 7, 2009 5:11 PM