0

I am developing a Windows Store app using the new universal app stuff (I am not including a phone project currently). Intermittently at run time I get a Windows.UI.Xaml.Markup.XamlParseException with the message Failed to assign to property 'Windows.UI.Xaml.Controls.ContentPresenter.Content'.

The key here is this is intermittent, I can run the app many times with no issue and then suddenly it will happen & if I restart it seldom if ever happens immediately afterwards. It only shows up at runtime.

In terms of environment, on every page I have a custom content control which we use to set the chrome for the page, so that it is uniform and also so we can handle popups etc... The XAML for that control is at: http://pastebin.com/T6KNWhxy

The issue occurs on most pages, however the camera page (XAML at http://pastebin.com/azdQ33Y2) seems to have it happen far more often.

I have built a light app which uses the same controls that reproduces the problem fairly consistently: https://github.com/rmaclean/HeatherSpeedApp

It also happens when running normally (i.e. without debugging). Loading up the dump file from that crash has the following error (which matches the details in the event log):

Unhandled exception at 0x7582B152 (combase.dll) in triagedump.dmp: 0xC000027B: An application-internal exception has occurred (parameters: 0x055C31F8, 0x00000004).

I have tried:

Any suggestions on what could be causing it?

Exception details

{"XAML parsing failed."}
[Windows.UI.Xaml.Markup.XamlParseException]: {"XAML parsing failed."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
HResult: -2144665590
InnerException: null
Message: "XAML parsing failed."
Source: null
StackTrace: null
TargetSite: null
Community
  • 1
  • 1
Robert MacLean
  • 38,975
  • 25
  • 98
  • 152
  • Do you have some embedded collections somewhere, looks like you're having trouble populating the ContentPresenter of the style template on one (or more) of your controls? Can you share some of the troubled xaml assuming you've gone through the deductive reasoning to find an idea of where you culprit is. – Chris W. Aug 28 '14 at 15:18
  • @ChrisW. "embedded collections" - what are you referring to? "populating the ContentPresenter of the style template" - I suspect that is the issue too but I cannot find any issues in that XAML. What makes it odd is it is intermittent, so the control is working a majority of the time and then just stops for no reason. – Robert MacLean Aug 29 '14 at 11:59
  • @ChrisW. "Can you share some of the troubled xaml" - I can try clean it up, but for the control it is a lot of XAML in it and in the styles.xaml... – Robert MacLean Aug 29 '14 at 11:59
  • embedded collections, like do you have something that takes an itemsource like a datagrid, itemscontrol, gridview etc embedded in another one, or even nested further? I hear you on the lots of xaml piece and the intermittent nature, tough to say without a way to consistently re-produce it or see the nature of the beast via some code. – Chris W. Aug 29 '14 at 14:01
  • @ChrisW. we have a custom content control which contains the page content and could have an collection inside it. However the pages most prone to this issue do not have any collections on them at all. I agree, if I could consistently reproduce it would help. – Robert MacLean Sep 02 '14 at 11:27

1 Answers1

1

The cause is having a custom ContentControl which has more than one ContentPresenter on it. If more than one of the ContentPresenters has a default value of null, then the XAML engine will have an intermittent failure caused by it not being able to layout correctly.

The work around is to set the default value to be an empty Grid or similar object.

Full internal details of the issue are here.

Robert MacLean
  • 38,975
  • 25
  • 98
  • 152