Solving AG_E_PARSER_BAD_TYPE In Silverlight

If you search for AG_E_PARSER_BAD_TYPE, you’ll find many entries going back to early Betas of Silverlight, which may or may not be applicable today. When I received this error, my search led me to Bill Kratochvil’s blog entry, AG_E_PARSER_BAD_TYPE Adding Silverlight Toolkit control to module.

In my particular problem, I was using Prism and my project with Shell.xaml (Project A) referenced another project module (Project B), which referenced two utility libraries (Project C and Project D). The occurred during the call to InitializeComponent() in a View in Project C. The line number and column in the exception message specified code in the View XAML that referred to an object in Project D.  Going back to Project A, where Shell.xaml resides, I observed that Project A referenced Project B and Project C, but not Project D.  I fixed the problem by adding a reference from Project A to Project D.

So, adding to Bill’s observation, it appears that this problem can be solved by locating the project of the object in the XAML where the error occurs (Project D) and ensuring that the project containing Shell.xaml (Project A) has a reference to Project D. 

Published by Joe Mayo

Author and independent software consultant. Specializing in Microsoft .NET technology. #ai #botframework #chatbots

Leave a comment