How to fix it: is the XAML2009 language design prohibited here?

In my App.xaml code, I have the following code:

<Application x:Class="PcgTools.App" ... <Application.Resources> <ResourceDictionary> ... <res:Strings x:FactoryMethod="res:StringResourceHelper.GetStringResources" x:Key="LocStrings"/> </ResourceDictionary> </Application.Resources> </Application> 

I received an error from the VS2012 compiler before using the FactoryMethod or Attribute construct. But now I get the error: the Xaml2009 language construct is not allowed here.

How to fix it?

+5
wpf visual-studio-2012 xaml
Jan 15 '13 at 21:23
source share
2 answers

XAML 2009 is not allowed in compiled XAML (at least not in WPF 4.0), try moving your stuff that uses 2009 constructs to a separate resource dictionary file.

+7
Jan 15 '13 at 22:40
source share
β€” -

XAML 2009, unfortunately, is useless due to the lack of compiler support (although VS recognizes this for some silly reason).

See: MSDN Document at XAML 2009

In principle, the current compiler (WPF, SL, WinRT) does not actually support it. As far as I know, the only thing that supports XAML 2009 is "free xaml", where you have a standalone xaml file that the browser opens directly (which is basically useless).

I don’t know any explanation from Microsoft explaining why this is not supported on earth. :-(

+10
Jan 16 '13 at 4:33
source share



All Articles