XamlParserException - AG_E_PARSER_BAD_TYPE

by Donn Felker 14. November 2008 04:11

Ohhhhh the dreaded XamlParserException. The exception message is not to helpful at all.

In my instance I was working with Silverlight. Namely working with the Prism  V2 Drop #5 from the Composite WPF team. Get the latest and read up the project here. I was loading the TreeView control into my view (Xaml) and when the app fired up the project would bomb with this exception and the message was VERY informative *sarcasm*.

AG_E_PARSER_BAD_TYPE

Hmm... Ok. Sure. Sounds good.

I have my projects laid out like so.

image

 

The Prism Shell (Top) loads different modules at runtime. Module A has a view (View 1) which has a tree view. Therefore, Module A (which is a Silverlight App itself) references the Microsoft.Windows.Controls library which contains the new controls for Silverlight (download them here). When this was getting compiled and referenced at runtime, the Microsoft.Windows.Controls dll was not in the Shell project, therefore it would blow up when it tried to parse the Xaml. Giving me the lovelly and dreaded XamlParserException.

The Fix

Simple. Add a reference to the Microsoft.Windows.Controls dll in the main Prism App. Then.... BLAMMO... the control toolkit works as expected. 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Silverlight

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Donn Felker

Senior Consultant
MCTS
ScrumMaster
Agile Practitioner

About Me | Books I Recommend

Gotta Pay The Bills


Tag cloud

    Popular Posts

    RecentComments

    Comment RSS

    Calendar

    <<  November 2008  >>
    MoTuWeThFrSaSu
    272829303112
    3456789
    10111213141516
    17181920212223
    24252627282930
    1234567

    View posts in large calendar