Discussion Dot in the project's name cause XAMLParseException

  • Saturday, August 18, 2012 7:38 PM
     
     

    Hey,

    I found issue with project' name after migrating from Windows RP to Windows 8 RTM with VS 2012. Mainly, I cannot use anymore "dots" in the projects' name. If I do that, I am getting XAMLParseException in the UserControls.

    Before, I could name project e.g. Game.Controls, now it doesn't work anymore. Project's name is translated into "Game_Controls" ({filename}.g.i.cs).

    I described problem and solution for it on my blog in case someone will need it: Migrating Windows RP application to Windows 8 RTM – XAMLParseException

    Regards,

    Jacek


    --- Jacek Ciereszko http://jacekciereszko.pl http://geekswithblogs.net/silverblog

All Replies

  • Saturday, August 18, 2012 8:53 PM
     
     
    @Jacek - this was a late bug found, and a hotfix is available: http://aka.ms/dotex for instructions on how to obtain.

    Tim Heuer | Program Manager, XAML | http://timheuer.com/blog | @timheuer

    (if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)

  • Sunday, August 19, 2012 5:03 PM
     
     
    Thanks Tim! :)

    Jacek Ciereszko (http://jacekciereszko.pl, http://BestW8Apps.com, http://geekswithblogs.net/silverblog)

  • Wednesday, August 22, 2012 9:51 PM
     
     

    @Tim - does this fix also help with the bug having a dash (-) in The assembly name of a class library?


    Chris Muench, MVP

  • Wednesday, August 22, 2012 11:03 PM
     
     
    @Chris - it should.  There was a 'safe name' routine that was being too safe for .NET (which has different rules than C++).  Keep in mind that .NET will translate Foo-Lib to Foo_Lib as the namespace and that becomes the resource key path for the lib.

    Tim Heuer | Program Manager, XAML | http://timheuer.com/blog | @timheuer

    (if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)

  • Thursday, August 23, 2012 6:10 PM
     
     

    Except that this does not work in VS2012 RTM, right?

    My Assembly name is "C-Labs"

    In the App.xaml of my hosting App I had the resource directory link set to:

    <ResourceDictionarySource="ms-appx:///C_Labs/C-DLights/Metro/StandardStyles.xaml"/>

    That gave me the XMP Parser error. I also tried the C-Labs/C-DLights... resulting in the same error.

    Once I removed the - from the assembly name and the _ from the link it worked just fine (even with the - in the Folder name).

    This worked correctly (without change) in the RC but not in the RTM of VS2012


    Chris Muench, MVP

  • Thursday, August 23, 2012 6:53 PM
     
      Has Code

    Hey Chris, I'm looking into this more.  The situation is that the "-" isn't a valid char for a namespace in .NET and it translates that to a "_" char which is valid.  The app contents, however are deployed to a folder matching the assembly name (not namespace name).  In your case of your ResourceDictionary it should be:

    ms-appx:///C-Labs/C-DLights/Metro/StandardStyles.xaml

    as the URI for the merged dictionary.  However any *UserControls* (anything using LoadComponent) looks to still fail here and I'll work to investigate that.

    The obvious workaround is not to use characters that are not namespace-safe in your assembly names as that will result in a mismatch of file name and root assembly lookups.


    Tim Heuer | Program Manager, XAML | http://timheuer.com/blog | @timheuer

    (if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)